usocket-cvs
Threads by month
- ----- 2025 -----
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
February 2012
- 1 participants
- 9 discussions
Author: ctian
Date: Mon Feb 27 07:10:32 2012
New Revision: 691
Log:
[usocket-web] documentation updates for 0.5.5
Modified:
public_html/api-docs.shtml
public_html/index.shtml
Modified: public_html/api-docs.shtml
==============================================================================
--- public_html/api-docs.shtml Mon Feb 27 06:58:41 2012 (r690)
+++ public_html/api-docs.shtml Mon Feb 27 07:10:32 2012 (r691)
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>USOCKET API documentation</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- <meta http-equiv="Content-Type"
- content="text/html; charset=ISO-8859-1">
- <style type="text/css">
+ <head>
+ <title>USOCKET API documentation</title>
+ <link rel="stylesheet" type="text/css" href="style.css">
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <style type="text/css">
dt.sym {
font-weight: normal;
background-color: #8ca;
@@ -28,422 +28,535 @@
border: 1px solid black;
}
</style>
-</head>
-<body>
-<ul>
- <li><a href="#docs">API documentation</a></li>
- <li><a href="#faqs">How do I ... (FAQ)</a></li>
-</ul>
-<h1><a name="docs">USOCKET API documentation</a></h1>
-<p style="font-size: 8px;">$Id$<br>
-Work in progress.</p>
-<p><em>Please note that we're committed to the interface described
-below for the entire 0.x phase of the library. When 1.0 comes
-some of the functionality may be split up in different functions
-and guarantees may change because of it.</em></p>
-<h2>Conventions</h2>
-<dl>
- <dt>Specification of a <em>host</em> or <em>local-host</em>
-parameter</dt>
- <dd>A <em>host</em> or <em>local-host</em> parameter may be any one
-of
+ </head>
+ <body>
<ul>
- <li>32-bit positive integer,</li>
- <li>A four element integer list representing IPv4 address, i.e.
-#(127 0 0 1)<br>
- </li>
- <li>a string containing an IP addres in dotted notation, or</li>
- <li> a host name to be resolved through DNS lookup.</li>
+ <li><a href="#docs">API documentation</a></li>
+ <li><a href="#faqs">How do I ... (FAQ)</a></li>
</ul>
- </dd>
-</dl>
-<h2>Functions for socket creation and manipulation</h2>
-<dl>
- <dt class="sym"><span class="function-name"><a name="socket-connect">socket-connect</a></span>
-host port &key protocol element-type timeout deadline nodelay
-local-host local-port => socket</dt>
- <dd>
- <p>Creates a TCP (stream) or UDP (datagram) socket to the <em>host</em>
-and <em>port</em> specified. The return value is
-a socket object of class <em><a href="#stream-usocket">stream-usocket</a></em>,
-or
- <a href="#datagram-usocket"><em>datagram-usocket</em></a>.</p>
- <p><em>protocol</em> should be <code>:stream</code> (default) or <code>:datagram</code>,
-which
-means
-TCP
-or
-UDP <cite>(Start from USOCKET 0.5)</cite><br>
- <em>element-type</em> argument is used in the
-construction of the associated stream, i.e. <code>'character</code> or
- <code>'(unsigned-byte 8)</code>, only used by TCP.<br>
- <em>timeout</em> is a integer, it represents the socket option <code>SO_RCVTIMEO</code>
-(read timeout), in seconds.<br>
- <em>deadline</em> is only supported in Clozure CL and Digitool MCL,
-look up their documents please.<br>
- <em>local-host</em> and <em>local-port</em>, when specified, will
-cause the socket calling bind() on local address. This is useful for
-selecting interfaces to send, or listening on UDP port. Note: use only
-one of them are allowed when reasonable (listen on wildcard address, or
-bind to random free port). <br>
- <br>
- </p>
- </dd>
- <dt class="sym"> <span class="function-name"><a name="socket-listen"></a>socket-listen</span>
-host port &key reuse-address backlog element-type => socket</dt>
- <dd>
- <p>Creates and returns a passive ("server") socket associated with <em>host</em>
-and <em>port</em>. The object returned is of subtype <a
- href="#stream-server-usocket">stream-server-usocket</a>.</p>
- <p><em>host</em> names a local interface.<br>
- <em>port</em> names a local port, or 0 (zero) to request a random
-free port.<br>
- <em>reuse-address</em> is a boolean (t, nil) value signalling reuse
-of the address is requested (or not).<br>
- <em>backlog</em> is the length of the queue containing connections
-which haven't actually been accepted yet.<br>
- <em>element-type</em> is the default element type used for sockets
-created by socket-accept. <em>character</em> is the default when it's
-not explicitly provided. </p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="socket-accept">socket-accept</a></span>
-socket &key element-type => new-socket</dt>
- <dd>
- <p>Creates and returns an active ("connected") stream socket <em>new-socket</em>
-from the <em>socket</em> passed. The return value is a socket object
-of class <em><a href="#stream-usocket">stream-usocket</a></em>.</p>
- <p><em>element-type</em> is the element type used to construct the
-associated stream. If it's not specified, the element-type of <em>socket</em>
-(as used when it was created by the call to socket-listen) is used. </p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="socket-close"></a>socket-close</span>
-socket</dt>
- <dd>
- <p>Flushes the stream associated with the socket and closes the
-socket connection.</p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="get-local-name"></a>get-local-name</span>
-socket => address, port<br>
- <span class="function-name"><a name="get-local-address"></a>get-local-address</span>
-socket => address<br>
- <span class="function-name"><a name="get-local-port"></a>get-local-port</span>
-socket => port</dt>
- <dd>
- <p>Returns the local address and/or port information of socket.</p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="get-peer-name"></a>get-peer-name</span>
-socket => address, port<br>
- <span class="function-name"><a name="get-peer-address"></a>get-peer-address</span>
-socket => address<br>
- <span class="function-name"><a name="get-peer-port"></a>get-peer-port</span>
-socket => port</dt>
- <dd>
- <p>Returns the remote address and/or port information of socket.
-The socket passed to this function must be a <em>connected</em> socket.</p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="socket-send"></a>socket-send</span>
-socket buffer length &key host port<br>
- </dt>
- <dd>
- <p>Send a (unsigned-byte 8) data buffer to a datagram socket, and
-return the number of bytes sent. (Start from USOCKET 0.5)</p>
- <p><em>socket</em> should be a <a href="#datagram-usocket"><em>datagram-usocket</em></a>.<br>
- <em>buffer</em> is a Lisp vector, type of <code>(simple-array
-(unsigned-byte 8) *)</code>.<br>
- <em>length</em> is used to tell <a href="#socket-send"><em>socket-send</em></a>
-the actual useful length of data buffer for sending to socket.<br>
- <em>host</em> and <em>port</em> are used for unconnected datagram
-sockets, for sending to specific destination.<br>
- </p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="socket-receive"></a>socket-receive</span>
-socket buffer length<br>
- </dt>
- <dd>
- <p>Receive data from a datagram socket, and return 4 values: <em>return-buffer</em>,
-
-
-
-
- <em>return-length</em>, <em>remote-host</em>, and <em>remove-port</em>.
-If
-the
-datagram
-socket
-was
-created
-by
-
-
-
- <a href="#socket-connect"><em>socket-connect</em></a>
-with a <em>timeout</em> keyword argument, this function will block at
-most that timeout value (in seconds). (Start from USOCKET 0.5) </p>
- <p><em>socket</em> should be a <a href="#datagram-usocket"><em>datagram-usocket</em></a>.<br>
- <em>buffer</em> is a Lisp vector, type of <code>(simple-array
-(unsigned-byte 8) *)</code>. Using <code>nil</code> here is also
-allowed, new buffer will be created to hold data.<br>
- <em>length</em> is used to specify the length of a exist buffer for
-receiving at most these data. Using <em>nil</em> here is allowed, and
-the actual length of <em>buffer</em> will be used; when <em>buffer</em>
-is also <code>nil</code>, a default maximum length (65507) will be
-used. <br>
- </p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="wait-for-input"></a>wait-for-input</span>
-socket-or-sockets &key timeout ready-only<br>
- </dt>
- <dd>
- <p>Waiting on one or multiple sockets for given time, and returns
-once some of them are available of reading data. This is like UNIX's
-"select" function.<br>
- <br>
-It returns two values: the first is the list of sockets which are
-readable (or in case of server sockets acceptable). nil may be returned
-for this value either when waiting timed out or when it was interrupted
-(EINTR). The second value is a real number indicating the time
-remaining within the timeout period or nil if none.<br>
- <br>
-Without the <em>ready-only</em> argument, WAIT-FOR-INPUT will return
-all sockets in
-the original list you passed it. This prevents a new list from being
-consed up. Some users of USOCKET were reluctant to use it if it
-wouldn't behave that way, expecting it to cost significant performance
-to do the associated garbage collection.<br>
- <br>
-Without the <em>ready-only</em> arg, you need to check the socket
-STATE slot for
-the values documented in <a href="#usocket"><em>usocket</em></a> class.<br>
- </p>
- </dd>
- <dt class="sym"><span class="function-name"><a name="socket-server"></a>socket-server</span>
-host port function &optional arguments &key in-new-thread
-protocol timeout max-buffer-size element-type reuse-address
-multi-threading<br>
- </dt>
- <dd>
- <p>Create a simple TCP or UDP socket server. (Start from USOCKET
-0.5)<br>
- </p>
- <p><em>host</em> names a local interface,<br>
- <em>port</em> names a local port,<br>
- <em>function</em> names a function object, which is used to handle
-TCP or UDP connections, the actual API of this function will be
-explained later.<br>
- <em>arguments</em> is a list used for passing extra arguments to
-user-defined <em>function</em>.<br>
- <em>in-new-thread</em> is a boolean, default is <code>nil</code>.
-When it's <code>T</code>, the server will be created in a new thread
-and socket-server returns immediately in current thread.<br>
- <em>protocol</em> could be either <code>:stream</code> (default)
-or <code>:datagram</code>, which decide the socket server is TCP
-server or UDP server.<br>
- <em>timeout</em> is UDP only, it provides the internal <a
- href="#socket-receive"><em>socket-receive</em></a> call (in UDP event
-loop of the socket server) a read timeout, default value is 1 (second).<br>
- <em>max-buffer-size</em> is UDP only, it's the max UDP data buffer
-size when handling UDP packets, default value is 65507.<br>
- <em>element-type</em> is TCP only, it's element-type of the stream
-provided for user-defined function,<br>
- <em>reuse-address</em> is TCP only, it's a boolean option for
-internal call of socket-listen in the socket server,<br>
- <em>multi-threading</em> is TCP only, it's a boolean, default value
-is <code>nil</code>. When it's <code>T</code>, each client connection
-will cause a new thread being created to handle that client, so that
-the TCP server could handle multiple clients at the same time. (Note:
-since UDP server is connectionless, it can always handle multiple
-clients, as long as the handler function run fast enough)<br>
- </p>
- <p>The handler function for TCP is stream-based. A template
-function
-is this one: </p>
- <pre>(defun default-tcp-handler (stream) ; null<br> (declare (type stream stream))<br> (terpri stream))</pre>
- <p>Note: 1. you don't need to close the stream as <a
- href="#socket-server"><em>socket-server</em></a>
-will do that for you.
-2. More function arguments can be defined, and these extra arguments
-must be feeded as the optional <em>arguments</em> of <a
- href="#socket-server"><em>socket-server</em></a>.</p>
- <p>The handler function for UDP is buffer-based, that is,
-you receive a buffer of data as input, and you return another buffer
-for output. A template function is a simple UDP echo server:</p>
- <pre>(defun default-udp-handler (buffer) ; echo<br> (declare (type (simple-array (unsigned-byte 8) *) buffer))<br> buffer)</pre>
- <p>Note: 1. data length is the length of the whole buffer. 2.
-Sometimes you may want to know the client's IP address and sending
-port, these informations are specially bounded on variables
- <a href="#remote-host"><em>*remote-host*</em></a> and <a
- href="#remote-port"><em>*remote-port*</em></a> when handler function
-is running.</p>
- </dd>
-</dl>
-<h2>Classes</h2>
-<dl>
- <dt class="sym"><span class="class-name"><a name="usocket">usocket</a></span></dt>
- <dd>Slots:
+ <h1><a name="docs">USOCKET API documentation</a></h1>
+ <p style="font-size: 8px;">$Id: api-docs.shtml 558 2010-09-15
+ 03:35:27Z ctian $<br>
+ Work in progress.</p>
+ <p><em>Please note that we're committed to the interface described
+ below for the entire 0.x phase of the library. When 1.0 comes
+ some of the functionality may be split up in different functions
+ and guarantees may change because of it.</em></p>
+ <h2>Conventions</h2>
+ <dl>
+ <dt>Specification of a <em>host</em> or <em>local-host</em>
+ parameter</dt>
+ <dd>A <em>host</em> or <em>local-host</em> parameter may be any
+ one
+ of
+ <ul>
+ <li>32-bit positive integer,</li>
+ <li>A four element integer list representing IPv4 address,
+ i.e.
+ #(127 0 0 1)<br>
+ </li>
+ <li>a string containing an IP addres in dotted notation, or</li>
+ <li> a host name to be resolved through DNS lookup.</li>
+ </ul>
+ </dd>
+ </dl>
+ <h2>Functions for socket creation and manipulation</h2>
<dl>
- <dt><span class="slot-name">socket</span> :accessor socket<br>
+ <dt class="sym"><span class="function-name"><a
+ name="socket-connect">socket-connect</a></span>
+ host port &key protocol element-type timeout deadline
+ nodelay
+ local-host local-port => socket</dt>
+ <dd>
+ <p>Creates a TCP (stream) or UDP (datagram) socket to the <em>host</em>
+ and <em>port</em> specified. The return value is
+ a socket object of class <em><a href="#stream-usocket">stream-usocket</a></em>,
+ or <a href="#datagram-usocket"><em>datagram-usocket</em></a>.</p>
+ <p><em>protocol</em> should be <code>:stream</code> (default)
+ or <code>:datagram</code>,
+ which
+ means
+ TCP
+ or
+ UDP <cite>(Start from USOCKET 0.5)</cite><br>
+ <em>element-type</em> argument is used in the
+ construction of the associated stream, i.e. <code>'character</code>
+ or <code>'(unsigned-byte 8)</code>, only used by TCP.<br>
+ <em>timeout</em> is a integer, it represents the socket option
+ <code>SO_RCVTIMEO</code>
+ (read timeout), in seconds.<br>
+ <em>deadline</em> is only supported in Clozure CL and Digitool
+ MCL,
+ look up their documents please.<br>
+ <em>local-host</em> and <em>local-port</em>, when specified,
+ will
+ cause the socket calling bind() on local address. This is
+ useful for
+ selecting interfaces to send, or listening on UDP port. Note:
+ use only
+ one of them are allowed when reasonable (listen on wildcard
+ address, or
+ bind to random free port). <br>
+ </p>
+ </dd>
+ <dd>
+ <p><em>nodelay</em> Allows to disable/enable Nagle's algorithm
+ (http://en.wikipedia.org/wiki/Nagle%27s_algorithm)<br>
+ If this parameter is omitted, the behaviour is inherited from
+ the CL implementation (in most cases, Nagle's algorithm is
+ enabled by default, but for example in ACL it is disabled).<br>
+ If the parmeter is specified, one of these three values is
+ possible: <br>
+ </p>
+ <ul>
+ <li><span style="font-weight: bold;">T</span> - Disable
+ Nagle's algorithm; signals an UNSUPPORTED condition if the
+ implementation does not support explicit manipulation with
+ that option.</li>
+ <li><span style="font-weight: bold;">NIL</span> - Leave
+ Nagle's algorithm enabled on the socket; signals an
+ UNSUPPORTED condition if the implementation does not support
+ explicit manipulation with that option.</li>
+ <li><span style="font-weight: bold;">:IF-SUPPORTED</span> -
+ Disables Nagle's algorithm if the implementation allow this,
+ otherwises just ignore this option.</li>
+ </ul>
+ <br>
+ </dd>
+ <dt class="sym"> <span class="function-name"><a
+ name="socket-listen"></a>socket-listen</span>
+ host port &key reuse-address backlog element-type =>
+ socket</dt>
+ <dd>
+ <p>Creates and returns a passive ("server") socket associated
+ with <em>host</em>
+ and <em>port</em>. The object returned is of subtype <a
+ href="#stream-server-usocket">stream-server-usocket</a>.</p>
+ <p><em>host</em> names a local interface.<br>
+ <em>port</em> names a local port, or 0 (zero) to request a
+ random
+ free port.<br>
+ <em>reuse-address</em> is a boolean (t, nil) value signalling
+ reuse
+ of the address is requested (or not).<br>
+ <em>backlog</em> is the length of the queue containing
+ connections
+ which haven't actually been accepted yet.<br>
+ <em>element-type</em> is the default element type used for
+ sockets
+ created by socket-accept. <em>character</em> is the default
+ when it's
+ not explicitly provided. </p>
+ </dd>
+ <dt class="sym"><span class="function-name"><a
+ name="socket-accept">socket-accept</a></span>
+ socket &key element-type => new-socket</dt>
+ <dd>
+ <p>Creates and returns an active ("connected") stream socket <em>new-socket</em>
+ from the <em>socket</em> passed. The return value is a socket
+ object
+ of class <em><a href="#stream-usocket">stream-usocket</a></em>.</p>
+ <p><em>element-type</em> is the element type used to construct
+ the
+ associated stream. If it's not specified, the element-type of
+ <em>socket</em>
+ (as used when it was created by the call to socket-listen) is
+ used. </p>
+ </dd>
+ <dt class="sym"><span class="function-name"><a name="socket-close"></a>socket-close</span>
+ socket</dt>
+ <dd>
+ <p>Flushes the stream associated with the socket and closes the
+ socket connection.</p>
+ </dd>
+ <dt class="sym"><span class="function-name"><a
+ name="get-local-name"></a>get-local-name</span>
+ socket => address, port<br>
+ <span class="function-name"><a name="get-local-address"></a>get-local-address</span>
+ socket => address<br>
+ <span class="function-name"><a name="get-local-port"></a>get-local-port</span>
+ socket => port</dt>
+ <dd>
+ <p>Returns the local address and/or port information of socket.</p>
+ </dd>
+ <dt class="sym"><span class="function-name"><a
+ name="get-peer-name"></a>get-peer-name</span>
+ socket => address, port<br>
+ <span class="function-name"><a name="get-peer-address"></a>get-peer-address</span>
+ socket => address<br>
+ <span class="function-name"><a name="get-peer-port"></a>get-peer-port</span>
+ socket => port</dt>
+ <dd>
+ <p>Returns the remote address and/or port information of socket.
+ The socket passed to this function must be a <em>connected</em>
+ socket.</p>
+ </dd>
+ <dt class="sym"><span class="function-name"><a name="socket-send"></a>socket-send</span>
+ socket buffer length &key host port<br>
</dt>
<dd>
- <p>Used to store sockets as used by the current implementation
-- may be any of socket handles, socket objects and stream objects</p>
+ <p>Send a (unsigned-byte 8) data buffer to a datagram socket,
+ and
+ return the number of bytes sent. (Start from USOCKET 0.5)</p>
+ <p><em>socket</em> should be a <a href="#datagram-usocket"><em>datagram-usocket</em></a>.<br>
+ <em>buffer</em> is a Lisp vector, type of <code>(simple-array
+ (unsigned-byte 8) *)</code>.<br>
+ <em>length</em> is used to tell <a href="#socket-send"><em>socket-send</em></a>
+ the actual useful length of data buffer for sending to socket.<br>
+ <em>host</em> and <em>port</em> are used for unconnected
+ datagram
+ sockets, for sending to specific destination.<br>
+ </p>
</dd>
- <dt><span class="slot-name">state</span> :accessor state<br>
+ <dt class="sym"><span class="function-name"><a
+ name="socket-receive"></a>socket-receive</span>
+ socket buffer length<br>
</dt>
<dd>
- <p>Used to store socket state: NIL (not ready), :READ (ready to
-read).<br>
+ <p>Receive data from a datagram socket, and return 4 values: <em>return-buffer</em>,
+ <em>return-length</em>, <em>remote-host</em>, and <em>remove-port</em>.
+ If
+ the
+ datagram
+ socket
+ was
+ created
+ by <a href="#socket-connect"><em>socket-connect</em></a>
+ with a <em>timeout</em> keyword argument, this function will
+ block at
+ most that timeout value (in seconds). (Start from USOCKET 0.5)
+ </p>
+ <p><em>socket</em> should be a <a href="#datagram-usocket"><em>datagram-usocket</em></a>.<br>
+ <em>buffer</em> is a Lisp vector, type of <code>(simple-array
+ (unsigned-byte 8) *)</code>. Using <code>nil</code> here is
+ also
+ allowed, new buffer will be created to hold data.<br>
+ <em>length</em> is used to specify the length of a exist
+ buffer for
+ receiving at most these data. Using <em>nil</em> here is
+ allowed, and
+ the actual length of <em>buffer</em> will be used; when <em>buffer</em>
+ is also <code>nil</code>, a default maximum length (65507)
+ will be
+ used. <br>
</p>
</dd>
- </dl>
- </dd>
- <dt class="sym"><span class="class-name"><a name="stream-usocket">stream-usocket</a></span></dt>
- <dd>Parent classes: usocket<br>
-Slots:
- <dl>
- <dt><span class="slot-name">stream</span> :accessor socket-stream</dt>
+ <dt class="sym"><span class="function-name"><a
+ name="wait-for-input"></a>wait-for-input</span>
+ socket-or-sockets &key timeout ready-only<br>
+ </dt>
<dd>
- <p>Used to store the stream associated with the tcp socket
-connection.<br>
-When you want to write to the socket stream, use this function.</p>
+ <p>Waiting on one or multiple sockets for given time, and
+ returns
+ once some of them are available of reading data. This is like
+ UNIX's
+ "select" function.<br>
+ <br>
+ It returns two values: the first is the list of sockets which
+ are
+ readable (or in case of server sockets acceptable). nil may be
+ returned
+ for this value either when waiting timed out or when it was
+ interrupted
+ (EINTR). The second value is a real number indicating
+ the time
+ remaining within the timeout period or nil if none.<br>
+ <br>
+ Without the <em>ready-only</em> argument, WAIT-FOR-INPUT will
+ return
+ all sockets in
+ the original list you passed it. This prevents a new list from
+ being
+ consed up. Some users of USOCKET were reluctant to use it if
+ it
+ wouldn't behave that way, expecting it to cost significant
+ performance
+ to do the associated garbage collection.<br>
+ <br>
+ Without the <em>ready-only</em> arg, you need to check the
+ socket
+ STATE slot for
+ the values documented in <a href="#usocket"><em>usocket</em></a>
+ class.<br>
+ </p>
+ </dd>
+ <dt class="sym"><span class="function-name"><a
+ name="socket-server"></a>socket-server</span>
+ host port function &optional arguments &key
+ in-new-thread
+ protocol timeout max-buffer-size element-type reuse-address
+ multi-threading<br>
+ </dt>
+ <dd>
+ <p>Create a simple TCP or UDP socket server. (Start from USOCKET
+ 0.5)<br>
+ </p>
+ <p><em>host</em> names a local interface,<br>
+ <em>port</em> names a local port,<br>
+ <em>function</em> names a function object, which is used to
+ handle
+ TCP or UDP connections, the actual API of this function will
+ be
+ explained later.<br>
+ <em>arguments</em> is a list used for passing extra arguments
+ to
+ user-defined <em>function</em>.<br>
+ <em>in-new-thread</em> is a boolean, default is <code>nil</code>.
+ When it's <code>T</code>, the server will be created in a new
+ thread
+ and socket-server returns immediately in current thread.<br>
+ <em>protocol</em> could be either <code>:stream</code>
+ (default)
+ or <code>:datagram</code>, which decide the socket server is
+ TCP
+ server or UDP server.<br>
+ <em>timeout</em> is UDP only, it provides the internal <a
+ href="#socket-receive"><em>socket-receive</em></a> call (in
+ UDP event
+ loop of the socket server) a read timeout, default value is 1
+ (second).<br>
+ <em>max-buffer-size</em> is UDP only, it's the max UDP data
+ buffer
+ size when handling UDP packets, default value is 65507.<br>
+ <em>element-type</em> is TCP only, it's element-type of the
+ stream
+ provided for user-defined function,<br>
+ <em>reuse-address</em> is TCP only, it's a boolean option for
+ internal call of socket-listen in the socket server,<br>
+ <em>multi-threading</em> is TCP only, it's a boolean, default
+ value
+ is <code>nil</code>. When it's <code>T</code>, each client
+ connection
+ will cause a new thread being created to handle that client,
+ so that
+ the TCP server could handle multiple clients at the same time.
+ (Note:
+ since UDP server is connectionless, it can always handle
+ multiple
+ clients, as long as the handler function run fast enough)<br>
+ </p>
+ <p>The handler function for TCP is stream-based. A template
+ function
+ is this one: </p>
+ <pre>(defun default-tcp-handler (stream) ; null<br> (declare (type stream stream))<br> (terpri stream))</pre>
+ <p>Note: 1. you don't need to close the stream as <a
+ href="#socket-server"><em>socket-server</em></a>
+ will do that for you.
+ 2. More function arguments can be defined, and these extra
+ arguments
+ must be feeded as the optional <em>arguments</em> of <a
+ href="#socket-server"><em>socket-server</em></a>.</p>
+ <p>The handler function for UDP is buffer-based, that is,
+ you receive a buffer of data as input, and you return another
+ buffer
+ for output. A template function is a simple UDP echo server:</p>
+ <pre>(defun default-udp-handler (buffer) ; echo<br> (declare (type (simple-array (unsigned-byte 8) *) buffer))<br> buffer)</pre>
+ <p>Note: 1. data length is the length of the whole buffer. 2.
+ Sometimes you may want to know the client's IP address and
+ sending
+ port, these informations are specially bounded on variables <a
+ href="#remote-host"><em>*remote-host*</em></a> and <a
+ href="#remote-port"><em>*remote-port*</em></a> when handler
+ function
+ is running.</p>
</dd>
</dl>
- </dd>
- <dt class="sym"><span class="class-name"><a
- name="stream-server-usocket">stream-server-usocket</a></span></dt>
- <dd>Parent classes: usocket<br>
-Slots:
+ <h2>Classes</h2>
<dl>
- <dt><span class="slot-name">element-type</span> :reader
-element-type</dt>
- <dd>
- <p>Indicates the default element-type to be used when
-constructing streams off this socket when no element type is specified
-in the call to <em><a href="#socket-accept">socket-accept</a></em>.</p>
+ <dt class="sym"><span class="class-name"><a name="usocket">usocket</a></span></dt>
+ <dd>Slots:
+ <dl>
+ <dt><span class="slot-name">socket</span> :accessor socket<br>
+ </dt>
+ <dd>
+ <p>Used to store sockets as used by the current
+ implementation
+ - may be any of socket handles, socket objects and stream
+ objects</p>
+ </dd>
+ <dt><span class="slot-name">state</span> :accessor state<br>
+ </dt>
+ <dd>
+ <p>Used to store socket state: NIL (not ready), :READ (ready
+ to
+ read).<br>
+ </p>
+ </dd>
+ </dl>
+ </dd>
+ <dt class="sym"><span class="class-name"><a name="stream-usocket">stream-usocket</a></span></dt>
+ <dd>Parent classes: usocket<br>
+ Slots:
+ <dl>
+ <dt><span class="slot-name">stream</span> :accessor
+ socket-stream</dt>
+ <dd>
+ <p>Used to store the stream associated with the tcp socket
+ connection.<br>
+ When you want to write to the socket stream, use this
+ function.</p>
+ </dd>
+ </dl>
+ </dd>
+ <dt class="sym"><span class="class-name"><a
+ name="stream-server-usocket">stream-server-usocket</a></span></dt>
+ <dd>Parent classes: usocket<br>
+ Slots:
+ <dl>
+ <dt><span class="slot-name">element-type</span> :reader
+ element-type</dt>
+ <dd>
+ <p>Indicates the default element-type to be used when
+ constructing streams off this socket when no element type
+ is specified
+ in the call to <em><a href="#socket-accept">socket-accept</a></em>.</p>
+ </dd>
+ </dl>
+ </dd>
+ <dt class="sym"><span class="class-name"><a
+ name="datagram-usocket">datagram-usocket
+ (Start
+ from
+ USOCKET
+ 0.5)<br>
+ </a></span></dt>
+ <dd>Parent classes: usocket<br>
+ Slots:
+ <dl>
+ <dt><span class="slot-name">connected-p</span> :accessor
+ connected-p</dt>
+ <dd>
+ <p>Used to identify if the datagram is connected. It will be
+ setup by <a href="#socket-connect"><em>socket-connect</em></a>,
+ and
+ used by <a href="#socket-send"><em>socket-send</em></a>
+ and <a href="#socket-receive"><em>socket-receive</em></a>.</p>
+ </dd>
+ </dl>
</dd>
</dl>
- </dd>
- <dt class="sym"><span class="class-name"><a name="datagram-usocket">datagram-usocket
-(Start
-from
-USOCKET
-0.5)<br>
- </a></span></dt>
- <dd>Parent classes: usocket<br>
-Slots:
+ <h2>Variables / constants</h2>
<dl>
- <dt><span class="slot-name">connected-p</span> :accessor
-connected-p</dt>
+ <dt class="sym"><span class="var-name">*wildcard-host*</span></dt>
<dd>
- <p>Used to identify if the datagram is connected. It will be
-setup by <a href="#socket-connect"><em>socket-connect</em></a>, and
-used by <a href="#socket-send"><em>socket-send</em></a> and <a
- href="#socket-receive"><em>socket-receive</em></a>.</p>
+ <p>The host to use with <a href="#socket-listen"><em>socket-listen</em></a>
+ to make the socket listen on all available interfaces.</p>
</dd>
- </dl>
- </dd>
-</dl>
-<h2>Variables / constants</h2>
-<dl>
- <dt class="sym"><span class="var-name">*wildcard-host*</span></dt>
- <dd>
- <p>The host to use with <a href="#socket-listen"><em>socket-listen</em></a>
-to make the socket listen on all available interfaces.</p>
- </dd>
- <dt class="sym"><span class="var-name">*auto-port*</span></dt>
- <dd>
- <p>The port number to use with socket-listen to make the socket
-listen on a random available port. The port number assigned can be
-retrieved from the returned socket by calling <em><a
- href="#get-local-port">get-local-port</a></em>.</p>
- </dd>
- <dt class="sym"><span class="var-name"><a name="remote-host"></a>*remote-host*</span></dt>
- <dd>
- <p>Special variable used in <a href="#socket-server"><em>socket-server</em></a>'s
+ <dt class="sym"><span class="var-name">*auto-port*</span></dt>
+ <dd>
+ <p>The port number to use with socket-listen to make the socket
+ listen on a random available port. The port number assigned
+ can be
+ retrieved from the returned socket by calling <em><a
+ href="#get-local-port">get-local-port</a></em>.</p>
+ </dd>
+ <dt class="sym"><span class="var-name"><a name="remote-host"></a>*remote-host*</span></dt>
+ <dd>
+ <p>Special variable used in <a href="#socket-server"><em>socket-server</em></a>'s
handler
function
for
getting
current
client
-address. (Start from
-USOCKET 0.5)<br>
- </p>
- </dd>
- <dt class="sym"><span class="var-name"><a name="remote-port"></a>*remote-port*</span></dt>
- <dd>
- <p>Special variable used in <a href="api-docs.shtml#socket-server"><em>socket-server</em></a>'s
+address.
+ (Start from
+ USOCKET 0.5)<br>
+ </p>
+ </dd>
+ <dt class="sym"><span class="var-name"><a name="remote-port"></a>*remote-port*</span></dt>
+ <dd>
+ <p>Special variable used in <a
+ href="api-docs.shtml#socket-server"><em>socket-server</em></a>'s
handler
function
for
getting
current
client
-port. (Start from USOCKET
-0.5)</p>
- </dd>
-</dl>
-<h1><a name="faqs">How do I ...</a></h1>
-<dl class="faq">
- <dt>... force the output to be written to the network? </dt>
- <dd>When you write output to the stream, it may be buffered before
-sent over the network - for optimal performance of small writes. You
-can force the buffer to be flushed the same way as with normal streams:
- <pre>(format (socket-stream socket) "Hello there~%") ;; output into buffers<br>(force-output (socket-stream socket)) ;; <== flush the buffers, if any<br></pre>
- </dd>
- <dt>... check whether the other end has closed my socket stream? </dt>
- <dd>Reading from a stream which has been closed at the remote end
-signals an END-OF-FILE condition, meaning that reading from the stream
-and detecting that condition is the way to do it. </dd>
- <dt>... check whether reading from a socket stream will block? </dt>
- <dd>When you want to check <b>one</b> stream for readiness of input,
-call the <a href="http://www.lisp.org/HyperSpec/Body/fun_listen.html">listen</a>
-function on the stream object associated with the socket.<br>
-Example:
- <pre>(listen (usocket:socket-stream your-socket))<br> ==> NIL (if no input is available)<br></pre>
- </dd>
- <dt>... wait for input to become available on (at least) one stream
-(of a set) </dt>
- <dd>Currently, that's hard to do efficiently if you want to use
-releases. The next minor release (0.4.0) will include this
-functionality and for all platforms (except SBCL and LispWorks; both
-Win32) it's already available in trunk
-(svn://common-lisp.net/project/usocket/svn/usocket/trunk). <br>
-If you want to use this code you're most welcome and feedback is
-appreciated.<br>
-Example to be used with trunk:
- <pre>(usocket:wait-for-input (list socket1 socket2 socket3) :timeout <your optional timeout value>)<br> ==> list-of-sockets-to-read-from</pre>
- </dd>
- <dt>... convert my existing trivial-sockets based application to
-usocket? </dt>
- <dd>There are actually 3 answers to that question.
- <ol>
- <li>Rewrite your code to keep a usocket object instead of the
-stream object returned by trivial-sockets.</li>
- <li>The quick conversion with the good performance
-characteristics (use only when you don't want to use the socket object):<br>
-Replace all your invocations of
- <pre> (trivial-sockets:open-socket-stream ....)<br><br>with<br> (usocket:socket-stream (usocket:socket-connect ...))<br></pre>
-And replace all invocations of
- <pre> (trivial-sockets:socket-accept ...)<br><br>with<br> (usocket:socket-stream (usocket:socket-accept ...))<br></pre>
-And replace all invocations of
- <pre> (trivial-sockets:open-server ...)<br><br>with<br> (usocket:socket-listen ...)<br></pre>
- </li>
- <li>And the last option which provides a compatible (but slower,
-because it uses Gray streams) interface is to use trivial-usocket.<br>
-The trivial-usocket package provides a 1-1 mapped interface to
-trivial-sockets, but uses Gray streams; that way, it's later possible
-to retrieve the socket object from the stream returned and to use that
-socket for other usocket operations. Use this approach as a migration
-path where you're not rewriting your application at once, but in small
-steps. </li>
- </ol>
- </dd>
-</dl>
-<div style="float: left; font-size: x-small; font-weight: bold;">
-Back to <a href="http://common-lisp.net/">Common-lisp.net</a>.
-</div>
-<div class="check" style="float: right;"> <a
- href="http://validator.w3.org/check/referer">Valid XHTML 1.0 Strict</a>
-</div>
-</body>
+port.
+ (Start from USOCKET
+ 0.5)</p>
+ </dd>
+ </dl>
+ <h1><a name="faqs">How do I ...</a></h1>
+ <dl class="faq">
+ <dt>... force the output to be written to the network? </dt>
+ <dd>When you write output to the stream, it may be buffered before
+ sent over the network - for optimal performance of small writes.
+ You
+ can force the buffer to be flushed the same way as with normal
+ streams:
+ <pre>(format (socket-stream socket) "Hello there~%") ;; output into buffers<br>(force-output (socket-stream socket)) ;; <== flush the buffers, if any<br></pre>
+ </dd>
+ <dt>... check whether the other end has closed my socket stream? </dt>
+ <dd>Reading from a stream which has been closed at the remote end
+ signals an END-OF-FILE condition, meaning that reading from the
+ stream
+ and detecting that condition is the way to do it. </dd>
+ <dt>... check whether reading from a socket stream will block? </dt>
+ <dd>When you want to check <b>one</b> stream for readiness of
+ input,
+ call the <a
+ href="http://www.lisp.org/HyperSpec/Body/fun_listen.html">listen</a>
+ function on the stream object associated with the socket.<br>
+ Example:
+ <pre>(listen (usocket:socket-stream your-socket))<br> ==> NIL (if no input is available)<br></pre>
+ </dd>
+ <dt>... wait for input to become available on (at least) one
+ stream
+ (of a set) </dt>
+ <dd>Currently, that's hard to do efficiently if you want to use
+ releases. The next minor release (0.4.0) will include this
+ functionality and for all platforms (except SBCL and LispWorks;
+ both
+ Win32) it's already available in trunk
+ (svn://common-lisp.net/project/usocket/svn/usocket/trunk) <br>
+ If you want to use this code you're most welcome and feedback is
+ appreciated.<br>
+ Example to be used with trunk:
+ <pre>(usocket:wait-for-input (list socket1 socket2 socket3) :timeout <your optional timeout value>)<br> ==> list-of-sockets-to-read-from</pre>
+ </dd>
+ <dt>... convert my existing trivial-sockets based application to
+ usocket? </dt>
+ <dd>There are actually 3 answers to that question.
+ <ol>
+ <li>Rewrite your code to keep a usocket object instead of the
+ stream object returned by trivial-sockets.</li>
+ <li>The quick conversion with the good performance
+ characteristics (use only when you don't want to use the
+ socket object):<br>
+ Replace all your invocations of
+ <pre> (trivial-sockets:open-socket-stream ....)<br><br>with<br> (usocket:socket-stream (usocket:socket-connect ...))<br></pre>
+ And replace all invocations of
+ <pre> (trivial-sockets:socket-accept ...)<br><br>with<br> (usocket:socket-stream (usocket:socket-accept ...))<br></pre>
+ And replace all invocations of
+ <pre> (trivial-sockets:open-server ...)<br><br>with<br> (usocket:socket-listen ...)<br></pre>
+ </li>
+ <li>And the last option which provides a compatible (but
+ slower,
+ because it uses Gray streams) interface is to use
+ trivial-usocket.<br>
+ The trivial-usocket package provides a 1-1 mapped interface
+ to
+ trivial-sockets, but uses Gray streams; that way, it's later
+ possible
+ to retrieve the socket object from the stream returned and
+ to use that
+ socket for other usocket operations. Use this approach as a
+ migration
+ path where you're not rewriting your application at once,
+ but in small
+ steps. </li>
+ </ol>
+ </dd>
+ </dl>
+ <div style="float: left; font-size: x-small; font-weight: bold;">
+ Back to <a href="http://common-lisp.net/">Common-lisp.net</a>.
+ </div>
+ <div class="check" style="float: right;"> <a
+ href="http://validator.w3.org/check/referer">Valid XHTML 1.0
+ Strict</a>
+ </div>
+ </body>
</html>
Modified: public_html/index.shtml
==============================================================================
--- public_html/index.shtml Mon Feb 27 06:58:41 2012 (r690)
+++ public_html/index.shtml Mon Feb 27 07:10:32 2012 (r691)
@@ -23,42 +23,34 @@
</ul>
<h2><a name="goal">Goal</a></h2>
<p>The project wants to provide a portable TCP/IP and UDP/IP socket
- interface for as many Common Lisp implementations as
- possible, while keeping the abstraction and portability layer as
- thin
- as possible. </p>
+ interface for as many Common Lisp implementations as possible,
+ while keeping the abstraction and portability layer as thin as
+ possible. </p>
<p>Because <a href="http://cliki.net/trivial-sockets">trivial-sockets</a>
has been declared dead and its author has said he will declare
- usocket
- its successor if there is a zero effort path of migration, I'm <b>also
-working
-on
- <em>trivial-usocket</em></b> which is supposed to be a
- sub-optimal,
- but zero
- effort migration from trivial-sockets.</p>
+ usocket its successor if there is a zero effort path of migration,
+ I'm <b>also
+ working
+ on <em>trivial-usocket</em></b> which is supposed to be a
+ sub-optimal, but zero effort migration from trivial-sockets.</p>
<p>If your lisp isn't mentioned in the list below, please feel free
- to
- submit a request for it at the mailing list mentioned below.</p>
+ to submit a request for it at the mailing list mentioned below.</p>
<h3>Comparison to other socket libraries</h3>
<p>Since usocket is effectively the succesor to trivial-sockets, see
the <a href="feature-comparison.shtml">feature comparison</a>
- with
- trivial-sockets in order to find out which one you should use.</p>
+ with trivial-sockets in order to find out which one you should
+ use.</p>
<p>After starting the project, many others turned out to have worked
- on
- something alike, many times as part of a broader project or
- library.
- Some of them were known at the start of this project, others have
- been
- conceived after the usocket project already started. Not all of
- them
- have exactly the same portability goal.</p>
+ on something alike, many times as part of a broader project or
+ library. Some of them were known at the start of this project,
+ others have been conceived after the usocket project already
+ started. Not all of them have exactly the same portability goal.</p>
<p>See the <a href="implementation-comparison.shtml">Implementation
comparison</a> page for a comparison of the portability of other
libaries and how that relates to usocket.</p>
<h2><a name="documentation">Documentation</a></h2>
<p>See the documentation page for the <a href="./api-docs.shtml">API
+
description</a>.</p>
<h2><a name="implementations">Supported implementations</a></h2>
<p>Currently these implementations are supported:</p>
@@ -82,58 +74,49 @@
<h2><a name="community">Community</a></h2>
<p>This project has started Januari 2006. There isn't much of a
community yet, though I'd like there to be one. So, you're invited
- to
- join the mailing list, announce yourself and even join the effort!
- </p>
+ to join the mailing list, announce yourself and even join the
+ effort! </p>
<p>Development discussion takes place on <a
href="http://common-lisp.net/cgi-bin/mailman/listinfo/usocket-devel">usocket-devel(a)common-lisp.net</a>.
</p>
<p>Project tracking happens in the <a
href="http://trac.common-lisp.net/usocket"> project's Trac setup</a>.
Please take note of the guidelines before entering a bug or
- enhancement
- request into the database.</p>
+ enhancement request into the database.</p>
<div class="roadmap">
<h2><a name="development">Development</a></h2>
<p>Development will at least follow the steps outlined below. Yet
- to be
- determined is whether the currently mentioned steps will be
- enough to
- release version 1.0. Possibly, UDP sockets remain to be
- addressed
- before doing 1.0; that will depend on your reactions :-) </p>
+ to be determined is whether the currently mentioned steps will
+ be enough to release version 1.0. Possibly, UDP sockets remain
+ to be addressed before doing 1.0; that will depend on your
+ reactions :-) </p>
<p>The targeted implementations listed in the status table below
- are
- not a final list: others can be added if/when the need or
- interest
- arrises. </p>
+ are not a final list: others can be added if/when the need or
+ interest arrises. </p>
<p><a
href="http://common-lisp.net/websvn/log.php?repname=usocket&path=%2Fusocket%2…">Active
+
development</a> is taking place in the <a
href="http://subversion.tigris.org/">Subversion</a>
- repository. To be
- kept up to date, please <a
+ repository. To be kept up to date, please <a
href="http://common-lisp.net/cgi-bin/mailman/listinfo/usocket-devel">subscribe
to
the
commit
message
mailing
- list</a>. To use the latest development
- version, make sure you have <a
- href="http://subversion.tigris.org/">Subversion</a>
+
+ list</a>. To use the latest development version, make sure you
+ have <a href="http://subversion.tigris.org/">Subversion</a>
installed and execute this command: </p>
<pre> $ svn checkout svn://common-lisp.net/project/usocket/svn/usocket/trunk usocket-svn<br> </pre>
<p>Please send patches, bug reports and suggestions to the
- development
- mailing list address given above. The table below indicates the
- current
- state of development. </p>
+ development mailing list address given above. The table below
+ indicates the current state of development. </p>
<table style="font-size: small;" rules="all" border="1"
cellpadding="3">
<caption style="font-weight: bold; font-size: large;">Status for
- the
- currently targeted backends</caption> <thead
+ the currently targeted backends</caption> <thead
class="roadmap-head"> <tr>
<th colspan="2">Major steps</th>
<th colspan="10">Socket implementations</th>
@@ -157,6 +140,7 @@
+
<br>
</a></th>
<th><a
@@ -170,13 +154,13 @@
</thead> <tbody>
<tr style="border-color: rgb(0, 0, 0); border-width: 2px;">
<td rowspan="5">Minimal active sockets support at the same
- level
- as provided by <a href="http://cliki.net/trivial-sockets">trivial-sockets</a>.<br>
+ level as provided by <a
+ href="http://cliki.net/trivial-sockets">trivial-sockets</a>.<br>
(Meaning streamed tcp traffic on connected sockets.)</td>
<td><a
href="http://common-lisp.net/websvn/filedetails.php?repname=usocket&path=%2Fu…">Investigate
- interfaces
- provided.</a></td>
+
+ interfaces provided.</a></td>
<td class="DONE">DONE</td>
<!-- SBCL --> <td class="DONE">DONE</td>
<!-- CMUCL --> <td class="DONE">DONE</td>
@@ -247,8 +231,8 @@
Local and remote IP address and port.</td>
<td><a
href="http://common-lisp.net/websvn/filedetails.php?repname=usocket&path=%2Fu…">Investigate
- interfaces
- provided</a></td>
+
+ interfaces provided</a></td>
<td class="DONE">DONE</td>
<!-- SBCL --> <td class="DONE">DONE</td>
<!-- CMUCL --> <td class="DONE">DONE</td>
@@ -329,12 +313,11 @@
</tr>
<tr>
<td rowspan="2">Implement efficient waiting for multiple
- sockets
- in one function call (select() like behaviour).</td>
+ sockets in one function call (select() like behaviour).</td>
<td><a
href="http://trac.common-lisp.net/usocket/wiki/SocketSelect">Investigate
- interfaces
- provided</a></td>
+
+ interfaces provided</a></td>
<td class="DONE">DONE</td>
<td class="DONE">DONE</td>
<td class="DONE">DONE</td>
@@ -391,8 +374,8 @@
<td rowspan="2">Implement udp socket support.</td>
<td><a
href="http://trac.common-lisp.net/usocket/wiki/DatagramSockets">Investigate
- API's
- provided</a></td>
+
+ API's provided</a></td>
<td class="DONE">DONE</td>
<td class="DONE">DONE</td>
<td class="DONE">DONE</td>
@@ -437,6 +420,25 @@
<th>Summary</th>
</tr>
<tr>
+ <td style="vertical-align: top;">Feb 27, 2012<br>
+ </td>
+ <td style="vertical-align: top;">0.5.5<br>
+ </td>
+ <td style="vertical-align: top;">LispWorks 6.1 compatibility;
+ SOCKET-CONNECT argument :nodelay can now set to
+ :if-supported<br>
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top;">Oct 1, 2011<br>
+ </td>
+ <td style="vertical-align: top;">0.5.4<br>
+ </td>
+ <td style="vertical-align: top;">Minor fixes for ECL, Allegro
+ CL modern mode, and SBCL.<br>
+ </td>
+ </tr>
+ <tr>
<td style="vertical-align: top;">Aug 13, 2011<br>
</td>
<td style="vertical-align: top;">0.5.3<br>
@@ -462,20 +464,16 @@
<td style="vertical-align: top;">0.5.1<br>
</td>
<td style="vertical-align: top;"><span style="font-weight:
- bold;">Improved
- CLISP support using FFI;</span> Lots of bugfix for CMUCL,
- SBCL,
- LispWorks, etc.<br>
+ bold;">Improved CLISP support using FFI;</span> Lots of
+ bugfix for CMUCL, SBCL, LispWorks, etc.<br>
</td>
</tr>
<tr>
<td>Mar 12, 2011</td>
<td style="font-weight: bold;">0.5.0</td>
<td><b>UDP support;</b> Lots of bugfixes since 0.4.1; support
- for
- WAIT-FOR-INPUT for SBCL and ECL on Win32; new platform
- added: Macintosh
- Common Lisp (5.0 and up)</td>
+ for WAIT-FOR-INPUT for SBCL and ECL on Win32; new platform
+ added: Macintosh Common Lisp (5.0 and up)</td>
</tr>
<tr>
<td>Dec 27, 2008</td>
@@ -507,17 +505,14 @@
<td>Jun 05, 2007</td>
<td>0.3.3</td>
<td>Fix where host resolution routine was unable to resolve
- would
- return NIL instead of erroring.</td>
+ would return NIL instead of erroring.</td>
</tr>
<tr>
<td>Mar 04, 2007</td>
<td>0.3.2</td>
<td>Fixes for many backends related to closing sockets.
- LispWorks
- fix for broken server sockets. API guarantee adjustments in
- preparation
- of porting Drakma.</td>
+ LispWorks fix for broken server sockets. API guarantee
+ adjustments in preparation of porting Drakma.</td>
</tr>
<tr>
<td>Feb 28, 2007</td>
@@ -529,8 +524,8 @@
<td>Feb 26, 2007</td>
<td>re-release</td>
<td>Re-release of 0.2.3, 0.2.4, 0.2.5 and 0.3.0 tarballs
- because
- the originals included Subversion administration areas.</td>
+ because the originals included Subversion administration
+ areas.</td>
</tr>
<tr>
<td>Jan 21, 2007</td>
@@ -551,8 +546,8 @@
<td>Jan 04, 2007</td>
<td>0.2.3</td>
<td>Add :element-type support to support stacking
- flexi-streams
- on socket streams for portable :external-format support.</td>
+ flexi-streams on socket streams for portable
+ :external-format support.</td>
</tr>
<tr>
<td>Jan 03, 2007</td>
@@ -570,11 +565,10 @@
<td>0.2.0</td>
<td>Add support for <a
href="http://www.scieneer.com/scl/index.html">Scieneer
- Common Lisp</a>,
- fix <a href="http://trac.common-lisp.net/usocket/ticket/6">issue
- #6</a>
- and API preparation for server side sockets (not in this
- release)</td>
+ Common Lisp</a>, fix <a
+ href="http://trac.common-lisp.net/usocket/ticket/6">issue
+ #6</a> and API preparation for server side sockets (not in
+ this release)</td>
</tr>
<tr>
<td>Feb 13, 2006</td>
@@ -586,17 +580,12 @@
<h2><a name="history">Project history</a></h2>
<p>Long ago the project was conceived and started by Erik Enge in an
attempt to factor out all implementation specific sockets code
- from
- <a href="/project/cl-irc">cl-irc</a>. This 'long ago' must have
- been
- way before 2003 when I entered the cl-irc project.</p>
+ from <a href="/project/cl-irc">cl-irc</a>. This 'long ago' must
+ have been way before 2003 when I entered the cl-irc project.</p>
<p>In january 2006, Erik Huelsmann found Erik Enge willing to donate
the code he had still laying around to restart the project. The
- restart
- took place at the 27th of january when the old code was imported
- into
- the
- public repository.<br>
+ restart took place at the 27th of january when the old code was
+ imported into the public repository.<br>
</p>
<p>Starting from 2008, Chun Tian (binghe) joined into usocket
development team with his UDP code base.<br>
@@ -604,11 +593,10 @@
<hr>
<div style="float: left; font-size: x-small; font-weight: bold;">Back
to
- <a href="http://common-lisp.net/">Common-lisp.net</a>.
- </div>
+
+ <a href="http://common-lisp.net/">Common-lisp.net</a>. </div>
<div class="check" style="float: right;"> <a
href="http://validator.w3.org/check/referer">Valid XHTML 1.0
- Strict</a>
- </div>
+ Strict</a> </div>
</body>
</html>
1
0
Author: ctian
Date: Mon Feb 27 06:58:41 2012
New Revision: 690
Log:
usocket 0.5.5
Added:
public_html/releases/usocket-0.5.5.tar.gz (contents, props changed)
public_html/releases/usocket-0.5.5.tar.gz.asc
Modified:
public_html/releases/usocket-latest.tar.gz
public_html/releases/usocket-latest.tar.gz.asc
Added: public_html/releases/usocket-0.5.5.tar.gz
==============================================================================
Binary file. No diff available.
Added: public_html/releases/usocket-0.5.5.tar.gz.asc
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ public_html/releases/usocket-0.5.5.tar.gz.asc Mon Feb 27 06:58:41 2012 (r690)
@@ -0,0 +1,8 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
+Comment: GPGTools - http://gpgtools.org
+
+iEYEABECAAYFAk9LmgwACgkQny6v4+l8uLBltQCg5Ji/zxylS+5+I+T7hQvlVUwr
+pe4AnA6jm6ZFwjZjB3iaX2lnXpwe2T3G
+=Byoy
+-----END PGP SIGNATURE-----
Modified: public_html/releases/usocket-latest.tar.gz
==============================================================================
--- public_html/releases/usocket-latest.tar.gz Mon Feb 27 06:57:23 2012 (r689)
+++ public_html/releases/usocket-latest.tar.gz Mon Feb 27 06:58:41 2012 (r690)
@@ -1 +1 @@
-link usocket-0.5.4.tar.gz
\ No newline at end of file
+link usocket-0.5.5.tar.gz
\ No newline at end of file
Modified: public_html/releases/usocket-latest.tar.gz.asc
==============================================================================
--- public_html/releases/usocket-latest.tar.gz.asc Mon Feb 27 06:57:23 2012 (r689)
+++ public_html/releases/usocket-latest.tar.gz.asc Mon Feb 27 06:58:41 2012 (r690)
@@ -1 +1 @@
-link usocket-0.5.4.tar.gz.asc
\ No newline at end of file
+link usocket-0.5.5.tar.gz.asc
\ No newline at end of file
1
0
Author: ctian
Date: Mon Feb 27 06:57:23 2012
New Revision: 689
Log:
Created tag 0.5.5.
Added:
usocket/tags/0.5.5/
- copied from r688, usocket/branches/0.5.x/
1
0
Author: ctian
Date: Mon Feb 27 06:56:33 2012
New Revision: 688
Log:
Update version info
Modified:
usocket/branches/0.5.x/usocket.asd
Modified: usocket/branches/0.5.x/usocket.asd
==============================================================================
--- usocket/branches/0.5.x/usocket.asd Mon Feb 27 06:49:55 2012 (r687)
+++ usocket/branches/0.5.x/usocket.asd Mon Feb 27 06:56:33 2012 (r688)
@@ -8,7 +8,7 @@
:name "usocket"
:author "Erik Enge & Erik Huelsmann"
:maintainer "Chun Tian (binghe)"
- :version "0.5.1"
+ :version "0.5.5"
:licence "MIT"
:description "Universal socket library for Common Lisp"
:depends-on (#+sbcl :sb-bsd-sockets)
1
0

27 Feb '12
Author: ctian
Date: Mon Feb 27 06:49:55 2012
New Revision: 687
Log:
Align with trunk (to r683), prepare for 0.5.5
Modified:
usocket/branches/0.5.x/CHANGES
usocket/branches/0.5.x/backend/abcl.lisp
usocket/branches/0.5.x/backend/allegro.lisp
usocket/branches/0.5.x/backend/clisp.lisp
usocket/branches/0.5.x/backend/cmucl.lisp
usocket/branches/0.5.x/backend/lispworks.lisp
usocket/branches/0.5.x/backend/mcl.lisp
usocket/branches/0.5.x/backend/openmcl.lisp
usocket/branches/0.5.x/backend/sbcl.lisp
usocket/branches/0.5.x/backend/scl.lisp
usocket/branches/0.5.x/usocket.lisp
Modified: usocket/branches/0.5.x/CHANGES
==============================================================================
--- usocket/branches/0.5.x/CHANGES Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/CHANGES Mon Feb 27 06:49:55 2012 (r687)
@@ -1,3 +1,11 @@
+0.5.5:
+
+* Enhancement: SOCKET-CONNECT argument :nodelay can now set to :if-supported (patch from Anton Vodonosov).
+* Enhancement: [server] adding *remote-host* *remote-port* to socket-server stream handler functions (suggested by Matthew Curry)
+* Bugfix: [LispWorks] Fixed UDP support for LispWorks 6.1 (patch from Camille Troillard by Martin Simmons).
+* Bugfix: [LispWorks] Stop using hcl:add-special-free-action for reclaiming unused UDP socket fds to improve multi-threading stablity (suggested by Camille Troillard).
+* Bugfix: [LispWorks] Fixed SOCKET-CONNECT on Windows, now LOCAL-PORT never have *auto-port* (0) as default value.
+
0.5.4:
* Bugfix: [ECL] Fixed for ECL's MAKE-BUILD by removing some unecessary code (reported by Juan Jose Garcia-Ripoll, the ECL maintainer)
Modified: usocket/branches/0.5.x/backend/abcl.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/abcl.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/abcl.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -212,7 +212,8 @@
(setq stream (ext:get-socket-stream socket :element-type element-type)
usocket (make-stream-socket :stream stream :socket socket))
(when nodelay-supplied-p
- (jcall $@setTcpNoDelay/1 socket (if nodelay +java-true+ +java-false+)))
+ (jcall $@setTcpNoDelay/1 socket (if nodelay ;; both t and :if-supported mean +java-true+
+ +java-true+ +java-false+)))
(when timeout
(jcall $@setSoTimeout/Socket/1 socket (truncate (* 1000 timeout))))))
(:datagram ; UDP
Modified: usocket/branches/0.5.x/backend/allegro.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/allegro.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/allegro.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -55,6 +55,8 @@
local-host local-port)
(when timeout (unsupported 'timeout 'socket-connect))
(when deadline (unsupported 'deadline 'socket-connect))
+ (when (eq nodelay :if-supported)
+ (setf nodelay t))
(let ((socket))
(setf socket
Modified: usocket/branches/0.5.x/backend/clisp.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/clisp.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/clisp.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -116,10 +116,11 @@
(defun socket-connect (host port &key (protocol :stream) (element-type 'character)
timeout deadline (nodelay t nodelay-specified)
local-host local-port)
- (declare (ignore nodelay)
- (ignorable timeout local-host local-port))
+ (declare (ignorable timeout local-host local-port))
(when deadline (unsupported 'deadline 'socket-connect))
- (when nodelay-specified (unsupported 'nodelay 'socket-connect))
+ (when (and nodelay-specified
+ (not (eq nodelay :if-supported)))
+ (unsupported 'nodelay 'socket-connect))
(case protocol
(:stream
(let ((socket)
Modified: usocket/branches/0.5.x/backend/cmucl.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/cmucl.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/cmucl.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -56,10 +56,11 @@
(local-port nil local-port-p)
&aux
(local-bind-p (fboundp 'ext::bind-inet-socket)))
- (declare (ignore nodelay))
(when timeout (unsupported 'timeout 'socket-connect))
(when deadline (unsupported 'deadline 'socket-connect))
- (when nodelay-specified (unsupported 'nodelay 'socket-connect))
+ (when (and nodelay-specified
+ (not (eq nodelay :if-supported)))
+ (unsupported 'nodelay 'socket-connect))
(when (and local-host-p (not local-bind-p))
(unsupported 'local-host 'socket-connect :minimum "Snapshot 2008-08 (19E)"))
(when (and local-port-p (not local-bind-p))
Modified: usocket/branches/0.5.x/backend/lispworks.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/lispworks.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/lispworks.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -183,7 +183,47 @@
len)
(float (/ (fli:dereference timeout) 1000))))
-(defun open-udp-socket (&key local-address local-port read-timeout)
+(defun initialize-dynamic-sockaddr (hostname service protocol &aux (original-hostname hostname))
+ (declare (ignorable original-hostname))
+ #+(or lispworks4 lispworks5 lispworks6.0)
+ (let ((server-addr (fli:allocate-dynamic-foreign-object
+ :type '(:struct comm::sockaddr_in))))
+ (values (comm::initialize-sockaddr_in
+ server-addr
+ comm::*socket_af_inet*
+ hostname
+ service protocol)
+ comm::*socket_af_inet*
+ server-addr
+ (fli:pointer-element-size server-addr)))
+ #-(or lispworks4 lispworks5 lispworks6.0)
+ (progn
+ (when (stringp hostname)
+ (setq hostname (comm:string-ip-address hostname))
+ (unless hostname
+ (let ((resolved-hostname (comm:get-host-entry original-hostname :fields '(:address))))
+ (unless resolved-hostname
+ (return-from initialize-dynamic-sockaddr :unknown-host))
+ (setq hostname resolved-hostname))))
+ (if (or (null hostname)
+ (integerp hostname)
+ (comm:ipv6-address-p hostname))
+ (let ((server-addr (fli:allocate-dynamic-foreign-object
+ :type '(:struct comm::lw-sockaddr))))
+ (multiple-value-bind (error family)
+ (comm::initialize-sockaddr_in
+ server-addr
+ hostname
+ service protocol)
+ (values error family
+ server-addr
+ (if (eql family comm::*socket_af_inet*)
+ (fli:size-of '(:struct comm::sockaddr_in))
+ (fli:size-of '(:struct comm::sockaddr_in6))))))
+ :bad-host)))
+
+(defun open-udp-socket (&key local-address local-port read-timeout
+ (address-family comm::*socket_af_inet*))
"Open a unconnected UDP socket.
For binding on address ANY(*), just not set LOCAL-ADDRESS (NIL),
for binding on random free unused port, set LOCAL-PORT to 0."
@@ -201,59 +241,55 @@
;; safe and it will be very fast after the first time.
#+win32 (comm::ensure-sockets)
- (let ((socket-fd (comm::socket comm::*socket_af_inet* *socket_sock_dgram* *socket_ip_proto_udp*)))
+ (let ((socket-fd (comm::socket address-family *socket_sock_dgram* *socket_ip_proto_udp*)))
(if socket-fd
- (progn
- (when read-timeout (set-socket-receive-timeout socket-fd read-timeout))
- (if local-port
- (fli:with-dynamic-foreign-objects ((client-addr (:struct comm::sockaddr_in)))
- (comm::initialize-sockaddr_in client-addr comm::*socket_af_inet*
- local-address local-port "udp")
- (if (comm::bind socket-fd
- (fli:copy-pointer client-addr :type '(:struct comm::sockaddr))
- (fli:pointer-element-size client-addr))
- ;; success, return socket fd
- socket-fd
- (progn
- (comm::close-socket socket-fd)
- (error "cannot bind"))))
+ (progn
+ (when read-timeout (set-socket-receive-timeout socket-fd read-timeout))
+ (if local-port
+ (fli:with-dynamic-foreign-objects ()
+ (multiple-value-bind (error local-address-family
+ client-addr client-addr-length)
+ (initialize-dynamic-sockaddr local-address local-port "udp")
+ (if (or error (not (eql address-family local-address-family)))
+ (progn
+ (comm::close-socket socket-fd)
+ (error "cannot resolve hostname ~S, service ~S: ~A"
+ local-address local-port (or error "address family mismatch")))
+ (if (comm::bind socket-fd client-addr client-addr-length)
+ ;; success, return socket fd
+ socket-fd
+ (progn
+ (comm::close-socket socket-fd)
+ (error "cannot bind"))))))
socket-fd))
(error "cannot create socket"))))
(defun connect-to-udp-server (hostname service
- &key local-address local-port read-timeout)
+ &key local-address local-port read-timeout)
"Something like CONNECT-TO-TCP-SERVER"
- (let ((socket-fd (open-udp-socket :local-address local-address
- :local-port local-port
- :read-timeout read-timeout)))
- (if socket-fd
- (fli:with-dynamic-foreign-objects ((server-addr (:struct comm::sockaddr_in)))
- ;; connect to remote address/port
- (comm::initialize-sockaddr_in server-addr comm::*socket_af_inet* hostname service "udp")
- (if (comm::connect socket-fd
- (fli:copy-pointer server-addr :type '(:struct comm::sockaddr))
- (fli:pointer-element-size server-addr))
- ;; success, return socket fd
- socket-fd
- ;; fail, close socket and return nil
- (progn
- (comm::close-socket socket-fd)
- (error "cannot connect"))))
- (error "cannot create socket"))))
-
-;; Register a special free action for closing datagram usocket when being GCed
-(defun usocket-special-free-action (object)
- (when (and (typep object 'datagram-usocket)
- (%open-p object))
- (socket-close object)))
-
-(eval-when (:load-toplevel :execute)
- (hcl:add-special-free-action 'usocket-special-free-action))
+ (fli:with-dynamic-foreign-objects ()
+ (multiple-value-bind (error address-family server-addr server-addr-length)
+ (initialize-dynamic-sockaddr hostname service "udp")
+ (when error
+ (error "cannot resolve hostname ~S, service ~S: ~A"
+ hostname service error))
+ (let ((socket-fd (open-udp-socket :local-address local-address
+ :local-port local-port
+ :read-timeout read-timeout
+ :address-family address-family)))
+ (if socket-fd
+ (if (comm::connect socket-fd server-addr server-addr-length)
+ ;; success, return socket fd
+ socket-fd
+ ;; fail, close socket and return nil
+ (progn
+ (comm::close-socket socket-fd)
+ (error "cannot connect")))
+ (error "cannot create socket"))))))
(defun socket-connect (host port &key (protocol :stream) (element-type 'base-char)
timeout deadline (nodelay t nodelay-specified)
- local-host (local-port #+win32 *auto-port* #-win32 nil))
- (declare (ignorable nodelay))
+ local-host local-port)
;; What's the meaning of this keyword?
(when deadline
@@ -264,7 +300,8 @@
(unsupported 'timeout 'socket-connect :minimum "LispWorks 4.4.5"))
#+(or lispworks4 lispworks5.0) ; < 5.1
- (when nodelay-specified
+ (when (and nodelay-specified
+ (not (eq nodelay :if-supported)))
(unsupported 'nodelay 'socket-connect :minimum "LispWorks 5.1"))
#+lispworks4 #+lispworks4
@@ -390,16 +427,19 @@
"Send message to a socket, using sendto()/send()"
(declare (type integer socket-fd)
(type sequence buffer))
- (fli:with-dynamic-foreign-objects ((client-addr (:struct comm::sockaddr_in)))
- (fli:with-dynamic-lisp-array-pointer (ptr message :type '(:unsigned :byte))
- (replace message buffer :end2 length)
- (if (and host service)
- (progn
- (comm::initialize-sockaddr_in client-addr comm::*socket_af_inet* host service "udp")
+ (fli:with-dynamic-lisp-array-pointer (ptr message :type '(:unsigned :byte))
+ (replace message buffer :end2 length)
+ (if (and host service)
+ (fli:with-dynamic-foreign-objects ()
+ (multiple-value-bind (error family client-addr client-addr-length)
+ (initialize-dynamic-sockaddr host service "udp")
+ (when error
+ (error "cannot resolve hostname ~S, service ~S: ~A"
+ host service error))
(%sendto socket-fd ptr (min length +max-datagram-packet-size+) 0
(fli:copy-pointer client-addr :type '(:struct comm::sockaddr))
- *length-of-sockaddr_in*))
- (comm::%send socket-fd ptr (min length +max-datagram-packet-size+) 0)))))
+ client-addr-length)))
+ (comm::%send socket-fd ptr (min length +max-datagram-packet-size+) 0))))
(defmethod socket-send ((socket datagram-usocket) buffer length &key host port)
(send-message (socket socket)
Modified: usocket/branches/0.5.x/backend/mcl.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/mcl.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/mcl.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -73,6 +73,8 @@
(defun socket-connect (host port &key (element-type 'character) timeout deadline nodelay
local-host local-port (protocol :stream))
+ (when (eq nodelay :if-supported)
+ (setf nodelay t))
(when (eq protocol :datagram)
(unsupported '(protocol :datagram) 'socket-connect))
(with-mapped-conditions ()
Modified: usocket/branches/0.5.x/backend/openmcl.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/openmcl.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/openmcl.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -85,6 +85,8 @@
(defun socket-connect (host port &key (protocol :stream) (element-type 'character)
timeout deadline nodelay
local-host local-port)
+ (when (eq nodelay :if-supported)
+ (setf nodelay t))
(with-mapped-conditions ()
(ecase protocol
(:stream
Modified: usocket/branches/0.5.x/backend/sbcl.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/sbcl.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/sbcl.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -261,8 +261,11 @@
;; package today. There's no guarantee the functions
;; we need are available, but we can make sure not to
;; call them if they aren't
+ (not (eq nodelay :if-supported))
(not sockopt-tcp-nodelay-p))
(unsupported 'nodelay 'socket-connect))
+ (when (eq nodelay :if-supported)
+ (setf nodelay t))
(let ((socket (make-instance 'sb-bsd-sockets:inet-socket
:type protocol
Modified: usocket/branches/0.5.x/backend/scl.lisp
==============================================================================
--- usocket/branches/0.5.x/backend/scl.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/backend/scl.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -34,8 +34,9 @@
(local-port nil local-port-p)
&aux
(patch-udp-p (fboundp 'ext::inet-socket-send-to)))
- (declare (ignore nodelay))
- (when nodelay-specified (unsupported 'nodelay 'socket-connect))
+ (when (and nodelay-specified
+ (not (eq nodelay :if-supported)))
+ (unsupported 'nodelay 'socket-connect))
(when deadline (unsupported 'deadline 'socket-connect))
(when timeout (unsupported 'timeout 'socket-connect))
(when (and local-host-p (not patch-udp-p))
Modified: usocket/branches/0.5.x/usocket.lisp
==============================================================================
--- usocket/branches/0.5.x/usocket.lisp Sat Feb 4 09:48:27 2012 (r686)
+++ usocket/branches/0.5.x/usocket.lisp Mon Feb 27 06:49:55 2012 (r687)
@@ -529,7 +529,7 @@
;; Documentation for the function
;;
-;; (defun SOCKET-CONNECT (host port &key element-type) ..)
+;; (defun SOCKET-CONNECT (host port &key element-type nodelay some-other-keys...) ..)
;;
(setf (documentation 'socket-connect 'function)
"Connect to `host' on `port'. `host' is assumed to be a string or
@@ -539,6 +539,20 @@
`element-type' specifies the element type to use when constructing the
stream associated with the socket. The default is 'character.
+`nodelay' Allows to disable/enable Nagle's algorithm (http://en.wikipedia.org/wiki/Nagle%27s_algorithm)
+If this parameter is omitted, the behaviour is inherited from the
+CL implementation (in most cases, Nagle's algorithm is
+enabled by default, but for example in ACL it is disabled).
+If the parmeter is specified, one of these three values is possible:
+ T - Disable Nagle's algorithm; signals an UNSUPPORTED
+ condition if the implementation does not support explicit
+ manipulation with that option.
+ NIL - Leave Nagle's algorithm enabled on the socket;
+ signals an UNSUPPORTED condition if the implementation does
+ not support explicit manipulation with that option.
+ :IF-SUPPORTED - Disables Nagle's algorithm if the implementation
+ allows this, otherwises just ignore this option.
+
Returns a usocket object.")
;; Documentation for the function
1
0
Author: ctian
Date: Sat Feb 4 09:48:27 2012
New Revision: 686
Log:
Fixed a bug in previous commit during argument name changes
Modified:
usocket/trunk/backend/allegro.lisp
usocket/trunk/backend/sbcl.lisp
Modified: usocket/trunk/backend/allegro.lisp
==============================================================================
--- usocket/trunk/backend/allegro.lisp Sat Feb 4 07:56:00 2012 (r685)
+++ usocket/trunk/backend/allegro.lisp Sat Feb 4 09:48:27 2012 (r686)
@@ -151,9 +151,9 @@
(values (get-peer-address usocket)
(get-peer-port usocket)))
-(defmethod socket-send ((socket datagram-usocket) buffer size &key host port (offset 0))
- (with-mapped-conditions (socket)
- (let ((s (socket socket)))
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0))
+ (with-mapped-conditions (usocket)
+ (let ((s (socket usocket)))
(socket:send-to s
(if (zerop offset)
buffer
Modified: usocket/trunk/backend/sbcl.lisp
==============================================================================
--- usocket/trunk/backend/sbcl.lisp Sat Feb 4 07:56:00 2012 (r685)
+++ usocket/trunk/backend/sbcl.lisp Sat Feb 4 09:48:27 2012 (r686)
@@ -399,7 +399,7 @@
(close (socket-stream usocket))))
(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0))
- (with-mapped-conditions (socket)
+ (with-mapped-conditions (usocket)
(let* ((s (socket usocket))
(dest (if (and host port) (list (host-to-vector-quad host) port) nil))
(real-buffer (if (zerop offset)
1
0
Author: ctian
Date: Sat Feb 4 07:56:00 2012
New Revision: 685
Log:
[UDP] SOCKET-SEND now support an CCL-like OFFSET keyword for sending only parts of the whole buffer.
Modified:
usocket/trunk/CHANGES
usocket/trunk/backend/abcl.lisp
usocket/trunk/backend/allegro.lisp
usocket/trunk/backend/clisp.lisp
usocket/trunk/backend/cmucl.lisp
usocket/trunk/backend/lispworks.lisp
usocket/trunk/backend/openmcl.lisp
usocket/trunk/backend/sbcl.lisp
usocket/trunk/backend/scl.lisp
Modified: usocket/trunk/CHANGES
==============================================================================
--- usocket/trunk/CHANGES Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/CHANGES Sat Feb 4 07:56:00 2012 (r685)
@@ -1,6 +1,7 @@
0.6.0:
* New feature: SOCKET-OPTION and (setf SOCKET-OPTION) for seting and geting various socket options.
+* New feature: [UDP] SOCKET-SEND now support an CCL-like OFFSET keyword for sending only parts of the whole buffer.
* (on the way) New feature: SOCKET-SHUTDOWN for TCP and UDP sockets.
* Enhancement: SOCKET-CONNECT argument :nodelay now support :if-supported as value (patch from Anton Vodonosov).
* Enhancement: Add *remote-host* *remote-port* to SOCKET-SERVER stream handler (suggested by Matthew Curry).
Modified: usocket/trunk/backend/abcl.lisp
==============================================================================
--- usocket/trunk/backend/abcl.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/abcl.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -335,19 +335,17 @@
(code-char ub8)
ub8)))
-(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port)
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0))
(let* ((socket (socket usocket))
- (real-length (or length (length buffer)))
- (byte-array (jnew-array $*byte real-length))
+ (byte-array (jnew-array $*byte size))
(packet (if (and host port)
- (jnew $%DatagramPacket/5 byte-array 0 real-length (host-to-inet4 host) port)
- (jnew $%DatagramPacket/3 byte-array 0 real-length))))
+ (jnew $%DatagramPacket/5 byte-array 0 size (host-to-inet4 host) port)
+ (jnew $%DatagramPacket/3 byte-array 0 size))))
;; prepare sending data
- (loop for i from 0 below real-length
+ (loop for i from offset below (+ size offset)
do (setf (jarray-ref byte-array i) (*->byte (aref buffer i))))
(with-mapped-conditions (usocket)
- (jcall $@send/1 socket packet))
- real-length))
+ (jcall $@send/1 socket packet))))
;;; TODO: return-host and return-port cannot be get ...
(defmethod socket-receive ((usocket datagram-usocket) buffer length
Modified: usocket/trunk/backend/allegro.lisp
==============================================================================
--- usocket/trunk/backend/allegro.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/allegro.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -151,10 +151,16 @@
(values (get-peer-address usocket)
(get-peer-port usocket)))
-(defmethod socket-send ((socket datagram-usocket) buffer length &key host port)
+(defmethod socket-send ((socket datagram-usocket) buffer size &key host port (offset 0))
(with-mapped-conditions (socket)
(let ((s (socket socket)))
- (socket:send-to s buffer length :remote-host host :remote-port port))))
+ (socket:send-to s
+ (if (zerop offset)
+ buffer
+ (subseq buffer offset (+ offset size)))
+ size
+ :remote-host host
+ :remote-port port))))
(defmethod socket-receive ((socket datagram-usocket) buffer length &key)
(declare (values (simple-array (unsigned-byte 8) (*)) ; buffer
Modified: usocket/trunk/backend/clisp.lisp
==============================================================================
--- usocket/trunk/backend/clisp.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/clisp.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -93,10 +93,12 @@
"Dispatch correct usocket condition."
(let (error-keyword error-string)
(typecase condition
+ #+ffi ; because OS:ERRNO and OS:STRERROR is only present if FFI is present.
(system::simple-os-error
(let ((errno (car (simple-condition-format-arguments condition))))
(setq error-keyword (os:errno errno)
error-string (os:strerror errno))))
+ #+ffi ; because OS:ERRNO and OS:STRERROR is only present if FFI is present.
(simple-error
(let ((keyword
(car (simple-condition-format-arguments condition))))
@@ -302,7 +304,7 @@
host
port))))
- (defmethod socket-send ((socket datagram-usocket) buffer length &key host port)
+ (defmethod socket-send ((socket datagram-usocket) buffer size &key host port (offset 0))
"Returns the number of octets sent."
(let* ((sock (socket socket))
(sockaddr (when (and host port)
@@ -311,19 +313,19 @@
(make-sockaddr_in)
(host-byte-order host)
port))))
- (real-length (or length (length buffer)))
+ (real-size (min size +max-datagram-packet-size+))
(real-buffer (if (typep buffer '(simple-array (unsigned-byte 8) (*)))
buffer
- (make-array real-length
+ (make-array real-size
:element-type '(unsigned-byte 8)
- :initial-contents (subseq buffer 0 real-length))))
+ :initial-contents (subseq buffer 0 real-size))))
(rv (if (and host port)
(rawsock:sendto sock real-buffer sockaddr
- :start 0
- :end real-length)
+ :start offset
+ :end (+ offset real-size))
(rawsock:send sock real-buffer
- :start 0
- :end real-length))))
+ :start offset
+ :end (+ offset real-size)))))
rv))
(defmethod socket-close ((usocket datagram-usocket))
@@ -631,30 +633,31 @@
;; in LispWorks. So, we allocate new foreign buffer for holding data (unknown sequence subtype) every time.
;;
;; I don't know if anyone is watching my coding work, but I think this design is reasonable for CLISP.
- (defmethod socket-send ((usocket datagram-usocket) buffer length &key host port)
+ (defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0))
(declare (type sequence buffer)
- (type integer length))
- (let ((remote-address (when (and host port)
- (fill-sockaddr_in (ffi:allocate-shallow 'sockaddr_in) host port)))
- (send-buffer (let ((buffer-length (length buffer)))
- (if (> buffer-length (* length 2))
- ;; if buffer is too big, then we copy out a subseq and only allocate as need
- (ffi:allocate-deep 'ffi:uint8 (subseq buffer 0 length) :count length :read-only t)
- ;; then we allocate the whole buffer directly, that should be faster.
- (ffi:allocate-deep 'ffi:uint8 buffer :count (length buffer) :read-only t))))
- (real-length (min length +max-datagram-packet-size+))
+ (type (integer 0 *) size offset))
+ (let ((remote-address
+ (when (and host port)
+ (fill-sockaddr_in (ffi:allocate-shallow 'sockaddr_in) host port)))
+ (send-buffer
+ (ffi:allocate-deep 'ffi:uint8
+ (if (zerop offset)
+ buffer
+ (subseq buffer offset (+ offset size)))
+ :count size :read-only t))
+ (real-size (min size +max-datagram-packet-size+))
(nbytes 0))
(unwind-protect
(let ((n (if remote-address
(%sendto (socket usocket)
(ffi:foreign-address send-buffer)
- real-length
+ real-size
0 ; flags
(ffi:cast (ffi:foreign-value remote-address) 'sockaddr)
*length-of-sockaddr_in*)
(%send (socket usocket)
(ffi:foreign-address send-buffer)
- real-length
+ real-size
0))))
(cond ((plusp n)
(setq nbytes n))
Modified: usocket/trunk/backend/cmucl.lisp
==============================================================================
--- usocket/trunk/backend/cmucl.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/cmucl.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -174,14 +174,17 @@
length
flags))
-(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port)
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0)
+ &aux (real-buffer (if (zerop offset)
+ buffer
+ (subseq buffer offset (+ offset size)))))
(with-mapped-conditions (usocket)
(if (and host port)
- (ext:inet-sendto (socket usocket) buffer length (host-to-hbo host) port)
+ (ext:inet-sendto (socket usocket) real-buffer size (host-to-hbo host) port)
#-unicode
- (unix:unix-send (socket usocket) buffer length 0)
+ (unix:unix-send (socket usocket) real-buffer size 0)
#+unicode
- (%unix-send (socket usocket) buffer length 0))))
+ (%unix-send (socket usocket) real-buffer size 0))))
(defmethod socket-receive ((usocket datagram-usocket) buffer length &key)
(declare (values (simple-array (unsigned-byte 8) (*)) ; buffer
Modified: usocket/trunk/backend/lispworks.lisp
==============================================================================
--- usocket/trunk/backend/lispworks.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/lispworks.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -423,28 +423,27 @@
(defvar *length-of-sockaddr_in*
(fli:size-of '(:struct comm::sockaddr_in)))
-(defun send-message (socket-fd message buffer &optional (length (length buffer)) host service)
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0)
+ &aux (socket-fd (socket usocket))
+ (message (slot-value usocket 'send-buffer)))
"Send message to a socket, using sendto()/send()"
(declare (type integer socket-fd)
(type sequence buffer))
+ (when host (setq host (host-to-hbo host)))
(fli:with-dynamic-lisp-array-pointer (ptr message :type '(:unsigned :byte))
- (replace message buffer :end2 length)
- (if (and host service)
+ (replace message buffer :start2 offset :end2 (+ offset size))
+ (if (and host port)
(fli:with-dynamic-foreign-objects ()
(multiple-value-bind (error family client-addr client-addr-length)
- (initialize-dynamic-sockaddr host service "udp")
+ (initialize-dynamic-sockaddr host port "udp")
+ (declare (ignore family))
(when error
- (error "cannot resolve hostname ~S, service ~S: ~A"
- host service error))
- (%sendto socket-fd ptr (min length +max-datagram-packet-size+) 0
+ (error "cannot resolve hostname ~S, port ~S: ~A"
+ host port error))
+ (%sendto socket-fd ptr (min size +max-datagram-packet-size+) 0
(fli:copy-pointer client-addr :type '(:struct comm::sockaddr))
client-addr-length)))
- (comm::%send socket-fd ptr (min length +max-datagram-packet-size+) 0))))
-
-(defmethod socket-send ((socket datagram-usocket) buffer length &key host port)
- (send-message (socket socket)
- (slot-value socket 'send-buffer)
- buffer length (and host (host-to-hbo host)) port))
+ (comm::%send socket-fd ptr (min size +max-datagram-packet-size+) 0))))
(defun receive-message (socket-fd message &optional buffer (length (length buffer))
&key read-timeout (max-buffer-size +max-datagram-packet-size+))
Modified: usocket/trunk/backend/openmcl.lisp
==============================================================================
--- usocket/trunk/backend/openmcl.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/openmcl.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -149,24 +149,25 @@
(with-mapped-conditions (usocket)
(close (socket usocket))))
-(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port offset)
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0))
(with-mapped-conditions (usocket)
(if (and host port)
- (openmcl-socket:send-to (socket usocket) buffer length
+ (openmcl-socket:send-to (socket usocket) buffer size
:remote-host (host-to-hbo host)
- :remote-port port)
+ :remote-port port
+ :offset offset)
;; Clozure CL's socket function SEND-TO doesn't support operations on connected UDP sockets,
;; so we have to define our own.
(let* ((socket (socket usocket))
(fd (ccl::socket-device socket)))
(multiple-value-setq (buffer offset)
- (ccl::verify-socket-buffer buffer offset length))
- (ccl::%stack-block ((bufptr length))
- (ccl::%copy-ivector-to-ptr buffer offset bufptr 0 length)
+ (ccl::verify-socket-buffer buffer offset size))
+ (ccl::%stack-block ((bufptr size))
+ (ccl::%copy-ivector-to-ptr buffer offset bufptr 0 size)
(ccl::socket-call socket "send"
(ccl::with-eagain fd :output
(ccl::ignoring-eintr
- (ccl::check-socket-error (#_send fd bufptr length 0))))))))))
+ (ccl::check-socket-error (#_send fd bufptr size 0))))))))))
(defmethod socket-receive ((usocket datagram-usocket) buffer length &key)
(with-mapped-conditions (usocket)
Modified: usocket/trunk/backend/sbcl.lisp
==============================================================================
--- usocket/trunk/backend/sbcl.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/sbcl.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -398,11 +398,14 @@
(with-mapped-conditions (usocket)
(close (socket-stream usocket))))
-(defmethod socket-send ((socket datagram-usocket) buffer length &key host port)
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port (offset 0))
(with-mapped-conditions (socket)
- (let* ((s (socket socket))
- (dest (if (and host port) (list (host-to-vector-quad host) port) nil)))
- (sb-bsd-sockets:socket-send s buffer length :address dest))))
+ (let* ((s (socket usocket))
+ (dest (if (and host port) (list (host-to-vector-quad host) port) nil))
+ (real-buffer (if (zerop offset)
+ buffer
+ (subseq buffer offset (+ offset size)))))
+ (sb-bsd-sockets:socket-send s real-buffer size :address dest))))
(defmethod socket-receive ((socket datagram-usocket) buffer length
&key (element-type '(unsigned-byte 8)))
Modified: usocket/trunk/backend/scl.lisp
==============================================================================
--- usocket/trunk/backend/scl.lisp Sat Feb 4 02:35:44 2012 (r684)
+++ usocket/trunk/backend/scl.lisp Sat Feb 4 07:56:00 2012 (r685)
@@ -136,14 +136,17 @@
(defmethod socket-close :after ((socket datagram-usocket))
(setf (%open-p socket) nil))
-(defmethod socket-send ((socket datagram-usocket) buffer length &key host port)
- (let ((s (socket socket))
- (host (if host (host-to-hbo host))))
+(defmethod socket-send ((usocket datagram-usocket) buffer size &key host port)
+ (let ((s (socket usocket))
+ (host (if host (host-to-hbo host)))
+ (real-buffer (if (zerop offset)
+ buffer
+ (subseq buffer offset (+ offset size)))))
(multiple-value-bind (result errno)
- (ext:inet-socket-send-to s buffer length
+ (ext:inet-socket-send-to s real-buffer size
:remote-host host :remote-port port)
(or result
- (scl-map-socket-error errno :socket socket)))))
+ (scl-map-socket-error errno :socket usocket)))))
(defmethod socket-receive ((socket datagram-usocket) buffer length &key)
(declare (values (simple-array (unsigned-byte 8) (*)) ; buffer
1
0

04 Feb '12
Author: ctian
Date: Sat Feb 4 02:35:44 2012
New Revision: 684
Log:
[CCL] move the implementation of SOCKET-SEND from ccl-send.lisp to openmcl.lisp, with offset support.
Deleted:
usocket/trunk/vendor/ccl-send.lisp
Modified:
usocket/trunk/CHANGES
usocket/trunk/backend/openmcl.lisp
usocket/trunk/usocket.asd
Modified: usocket/trunk/CHANGES
==============================================================================
--- usocket/trunk/CHANGES Fri Feb 3 20:31:26 2012 (r683)
+++ usocket/trunk/CHANGES Sat Feb 4 02:35:44 2012 (r684)
@@ -1,6 +1,7 @@
0.6.0:
-* New feature: SOCKET-OPTION for seting and geting various socket options.
+* New feature: SOCKET-OPTION and (setf SOCKET-OPTION) for seting and geting various socket options.
+* (on the way) New feature: SOCKET-SHUTDOWN for TCP and UDP sockets.
* Enhancement: SOCKET-CONNECT argument :nodelay now support :if-supported as value (patch from Anton Vodonosov).
* Enhancement: Add *remote-host* *remote-port* to SOCKET-SERVER stream handler (suggested by Matthew Curry).
* Bugfix: [LispWorks] Fixed UDP support for LispWorks 6.1 (patch from Camille Troillard by Martin Simmons).
@@ -59,8 +60,3 @@
* New feature: CLISP support some advanced TCP features which CLISP's SOCKET interface not provide
* New feature: Macintosh Common Lisp (MCL) support Datagram sockets (UDP)
-
-[TODO for 0.6.x]
-
-* New feature: SOCKET-SHUTDOWN for TCP and UDP sockets
-* Fix UDP in CCL 1.7 Windows |send| symbol is gone.
Modified: usocket/trunk/backend/openmcl.lisp
==============================================================================
--- usocket/trunk/backend/openmcl.lisp Fri Feb 3 20:31:26 2012 (r683)
+++ usocket/trunk/backend/openmcl.lisp Sat Feb 4 02:35:44 2012 (r684)
@@ -149,14 +149,24 @@
(with-mapped-conditions (usocket)
(close (socket usocket))))
-(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port)
+(defmethod socket-send ((usocket datagram-usocket) buffer length &key host port offset)
(with-mapped-conditions (usocket)
(if (and host port)
(openmcl-socket:send-to (socket usocket) buffer length
:remote-host (host-to-hbo host)
:remote-port port)
- ;; following functino was defined in "vendor/ccl-send.lisp"
- (ccl::send-for-usocket (socket usocket) buffer length))))
+ ;; Clozure CL's socket function SEND-TO doesn't support operations on connected UDP sockets,
+ ;; so we have to define our own.
+ (let* ((socket (socket usocket))
+ (fd (ccl::socket-device socket)))
+ (multiple-value-setq (buffer offset)
+ (ccl::verify-socket-buffer buffer offset length))
+ (ccl::%stack-block ((bufptr length))
+ (ccl::%copy-ivector-to-ptr buffer offset bufptr 0 length)
+ (ccl::socket-call socket "send"
+ (ccl::with-eagain fd :output
+ (ccl::ignoring-eintr
+ (ccl::check-socket-error (#_send fd bufptr length 0))))))))))
(defmethod socket-receive ((usocket datagram-usocket) buffer length &key)
(with-mapped-conditions (usocket)
Modified: usocket/trunk/usocket.asd
==============================================================================
--- usocket/trunk/usocket.asd Fri Feb 3 20:31:26 2012 (r683)
+++ usocket/trunk/usocket.asd Sat Feb 4 02:35:44 2012 (r684)
@@ -16,7 +16,6 @@
(:module "vendor" :depends-on ("package")
:components ((:file "split-sequence")
#+mcl (:file "kqueue")
- #+openmcl (:file "ccl-send")
(:file "spawn-thread")))
(:file "usocket" :depends-on ("vendor"))
(:file "condition" :depends-on ("usocket"))
1
0
Author: ctian
Date: Fri Feb 3 20:31:26 2012
New Revision: 683
Log:
[LispWorks] SOCKET-CONNECT shouldn't have *auto-port* as its default value, this is not supported by LispWorks 6.1 any more. (Thanks to Raymond Wiker)
Modified:
usocket/trunk/CHANGES
usocket/trunk/backend/lispworks.lisp
Modified: usocket/trunk/CHANGES
==============================================================================
--- usocket/trunk/CHANGES Sat Jan 28 12:49:31 2012 (r682)
+++ usocket/trunk/CHANGES Fri Feb 3 20:31:26 2012 (r683)
@@ -3,8 +3,9 @@
* New feature: SOCKET-OPTION for seting and geting various socket options.
* Enhancement: SOCKET-CONNECT argument :nodelay now support :if-supported as value (patch from Anton Vodonosov).
* Enhancement: Add *remote-host* *remote-port* to SOCKET-SERVER stream handler (suggested by Matthew Curry).
-* Bugfix: [LispWorks] Fixed UDP support for LispWorks 6.1 (patch from Camille Troillard).
+* Bugfix: [LispWorks] Fixed UDP support for LispWorks 6.1 (patch from Camille Troillard by Martin Simmons).
* Bugfix: [LispWorks] Stop using hcl:add-special-free-action for reclaiming unused UDP socket fds to improve multi-threading stablity (suggested by Camille Troillard).
+* Bugfix: [LispWorks] Fixed SOCKET-CONNECT on Windows, now LOCAL-PORT never have *auto-port* (0) as default value.
0.5.4:
@@ -62,3 +63,4 @@
[TODO for 0.6.x]
* New feature: SOCKET-SHUTDOWN for TCP and UDP sockets
+* Fix UDP in CCL 1.7 Windows |send| symbol is gone.
Modified: usocket/trunk/backend/lispworks.lisp
==============================================================================
--- usocket/trunk/backend/lispworks.lisp Sat Jan 28 12:49:31 2012 (r682)
+++ usocket/trunk/backend/lispworks.lisp Fri Feb 3 20:31:26 2012 (r683)
@@ -289,7 +289,7 @@
(defun socket-connect (host port &key (protocol :stream) (element-type 'base-char)
timeout deadline (nodelay t nodelay-specified)
- local-host (local-port #+win32 *auto-port* #-win32 nil))
+ local-host local-port)
;; What's the meaning of this keyword?
(when deadline
1
0