This code show how inetErrorCode() some times show error, althoug the program is MT each thread is started one by one.
function main() local socket, accept, cont inetInit() socket := inetServer( 2700 ) for nCont := 1 to 20 startThread( @envio(), socket ) waitForThreads() next return nil static function envio( socket ) local accept accept := inetAccept( socket ) inetRecvLine( accept ) inetSendAll( accept, "1" + inetCRLF() ) ? inetErrorCode( accept ) inetClose( accept ) return nil To test it you can use it for each connection telnet 127.0.0.1 2700 x --- in this line you type any leter and press enter or you can use this sample as client function main inetInit() fot i := 1 to 20 socket := inetConnect( "127.0.0.1", 2700 ) if inetErrorCode( socket ) == 0 inetSendAll( socket, "1" + inetCRLF() ) ? inetRecvLine( socket ) inetClose( socket ) endIf next return nil -- Saludos Quique ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers