net-close

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

net-close

Post 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.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post 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

Locked