Lines Matching refs:con
70 let queue con pkt = Queue.push pkt con.pkt_out
87 let read con b len =
88 match con.backend with
89 | Fd backfd -> read_fd backfd con b len
90 | Xenmmap backmmap -> read_mmap backmmap con b len
101 let write con s len =
102 match con.backend with
103 | Fd backfd -> write_fd backfd con s len
104 | Xenmmap backmmap -> write_mmap backmmap con s len
107 let output con =
109 let s = if String.length con.partial_out > 0 then
110 con.partial_out
111 else if Queue.length con.pkt_out > 0 then
112 Packet.to_string (Queue.pop con.pkt_out)
118 let sz = write con s len in
120 con.partial_out <- left
123 con.partial_out = ""
126 let input con =
129 match con.partial_in with
135 let sz = if to_read > 0 then read con b to_read else 0 in
138 match con.partial_in with
145 con.partial_in <- init_partial_in ();
146 Queue.push pkt con.pkt_in;
153 con.partial_in <- if sz = i then
176 let close con =
177 match con.backend with
181 let is_fd con =
182 match con.backend with
186 let is_mmap con = not (is_fd con)
188 let output_len con = Queue.length con.pkt_out
189 let has_new_output con = Queue.length con.pkt_out > 0
190 let has_old_output con = String.length con.partial_out > 0
192 let has_output con = has_new_output con || has_old_output con
194 let peek_output con = Queue.peek con.pkt_out
196 let input_len con = Queue.length con.pkt_in
197 let has_in_packet con = Queue.length con.pkt_in > 0
198 let get_in_packet con = Queue.pop con.pkt_in
199 let has_more_input con =
200 match con.backend with
204 let is_selectable con =
205 match con.backend with
209 let get_fd con =
210 match con.backend with