The following code from JHS may be relevant. Note Windows SO_REUSEADDR.
Watch line wrap!

dobind=: 3 : 0
sdcleanup_jsocket_''
SKLISTEN=: 0 pick sdcheck_jsocket_ sdsocket_jsocket_''
if. UNAME-:'Linux'  do. 'libc.so.6  fcntl i i i i' cd
SKLISTEN,F_SETFD_jsocket_,FD_CLOEXEC_jsocket_ end.
if. UNAME-:'Darwin' do. 'libc.dylib fcntl i i i i' cd
SKLISTEN,F_SETFD_jsocket_,FD_CLOEXEC_jsocket_ end.
if. -.UNAME-:'Win'  do. sdsetsockopt_jsocket_
SKLISTEN;SOL_SOCKET_jsocket_;SO_REUSEADDR_jsocket_;2-1 end.
sdbind_jsocket_ SKLISTEN;AF_INET_jsocket_;y;PORT
)


On Thu, Dec 16, 2010 at 10:47 AM, Henry Rich <[email protected]> wrote:

> I have a file server coded in J.  It listens on a port and responds to
> requests.
>
> This morning while testing I canceled the J window that the server was
> running in, and started it up again.  It failed because it said the port
> number was in use (EADDRINUSE, 10048).
>
> This means that when the previous J task was terminated, it was somehow
> left bound to its port.  This could be a problem in the field.
>
> I would think that this is an OS bug (Windows XP), but in case there is
> something that I or j.exe could do to prevent this, I'm reporting it here.
>
> Henry Rich
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to