slang-users mailing list

[2012 Date Index] [2012 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] Bug in socket module


Forgive me if either this is already a known bug or I am not
submitting to the appropriate place.

The help page for the accept function in socket-module indicates that
only one argument is required (and indeed it will block waiting for a
connection when only one arg is given), however, upon receipt of a
connection will error with a Stack_Underflow_Error unless the hostip
and port refs are provided. For example:

slsh> require("socket");
slsh> s=socket(AF_INET,SOCK_STREAM,0);
slsh> bind(s,"localhost",5555);
slsh> listen(s,5);
slsh> c=accept(s);
<... other side connects ...>
Stack Underflow Error
slsh> c;
Undefined_Type

Yet, providing refs for args 2 and 3:

slsh> c=accept(s,&hostip,&port);
<... other side connects ...>
slsh> c;
FD_Type

I think either the accept function should be modified to allow only
one arg or docs be modified accordingly.

Cheers,
-Arik



[2012 date index] [2012 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]