Page 1 of 1

net-close

Posted: Thu Feb 26, 2004 8:57 pm
by newdep
Hello Lutz,


Just a currious question..

When using 'net-close in a new started console the following happens;
and i was just currious if behaviour is related to the stderr stdin stdout?

>(net-close 0) # loops the console prompt

>(net-close 1) # waits

>(net-close 2) # returns true

PS: it would actualy be nice to be able in newlisp to have
access to a list using network functions, like: (net-close (net-sessions))


Regards,
Norman.

Posted: Mon Mar 01, 2004 1:05 pm
by Lutz
'net-close' ends up using the same function as 'close' is using. This is why 'net-close' on 0,1,2 affects stderr, sdin stdout.

In lisp there is a construct to make fucntions work on lists which is called 'map', so you could do:

(map close (net-sessions))

But careful do not do this in newLISP-tk environment becuase two TCP/IP connections are open to communicate between newlisp and newlisp-tk.

Lutz