comparison lisp/code-process.el @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 697ef44129c6
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
196 If VAL is a function symbol, the function must return a coding system 196 If VAL is a function symbol, the function must return a coding system
197 or a cons of coding systems which are used as above. 197 or a cons of coding systems which are used as above.
198 198
199 See also the function `find-operation-coding-system'.") 199 See also the function `find-operation-coding-system'.")
200 200
201 (defun open-network-stream (name buffer host service) 201 (defun open-network-stream (name buffer host service &optional protocol)
202 "Open a TCP connection for a service to a host. 202 "Open a TCP connection for a service to a host.
203 Returns a subprocess-object to represent the connection. 203 Return a subprocess-object to represent the connection.
204 Input and output work as for subprocesses; `delete-process' closes it. 204 Input and output work as for subprocesses; `delete-process' closes it.
205 Args are NAME BUFFER HOST SERVICE. 205 Args are NAME BUFFER HOST SERVICE.
206 NAME is name for process. It is modified if necessary to make it unique. 206 NAME is name for process. It is modified if necessary to make it unique.
207 BUFFER is the buffer (or buffer-name) to associate with the process. 207 BUFFER is the buffer (or buffer-name) to associate with the process.
208 Process output goes at end of that buffer, unless you specify 208 Process output goes at end of that buffer, unless you specify
209 an output stream or filter function to handle the output. 209 an output stream or filter function to handle the output.
210 BUFFER may be also nil, meaning that this process is not associated 210 BUFFER may be also nil, meaning that this process is not associated
211 with any buffer 211 with any buffer
212 Third arg is name of the host to connect to, or its IP address. 212 Third arg is name of the host to connect to, or its IP address.
213 Fourth arg SERVICE is name of the service desired, or an integer 213 Fourth arg SERVICE is name of the service desired, or an integer
214 specifying a port number to connect to." 214 specifying a port number to connect to.
215 Fifth argument PROTOCOL is a network protocol. Currently 'tcp
216 (Transmission Control Protocol) and 'udp (User Datagram Protocol) are
217 supported. When omitted, 'tcp is assumed.
218
219 Ouput via `process-send-string' and input via buffer or filter (see
220 `set-process-filter') are stream-oriented. That means UDP datagrams are
221 not guaranteed to be sent and received in discrete packets. (But small
222 datagrams around 500 bytes that are not truncated by `process-send-string'
223 are usually fine.) Note further that UDP protocol does not guard against
224 lost packets."
215 (let (cs-r cs-w) 225 (let (cs-r cs-w)
216 (let (ret) 226 (let (ret)
217 (catch 'found 227 (catch 'found
218 (let ((alist network-coding-system-alist) 228 (let ((alist network-coding-system-alist)
219 (case-fold-search nil) 229 (case-fold-search nil)
243 cs-w ret)))) 253 cs-w ret))))
244 (let ((coding-system-for-read 254 (let ((coding-system-for-read
245 (or coding-system-for-read cs-r)) 255 (or coding-system-for-read cs-r))
246 (coding-system-for-write 256 (coding-system-for-write
247 (or coding-system-for-write cs-w))) 257 (or coding-system-for-write cs-w)))
248 (open-network-stream-internal name buffer host service)))) 258 (open-network-stream-internal name buffer host service protocol))))
249 259
250 ;;; mule-process.el ends here 260 ;;; mule-process.el ends here