Error Report: Socket>>listenOn

Frank Gerlach frankgerlach22 at gmx.de
Sun Dec 26 22:50:02 UTC 2004


Just found out what the socket problem was:
Socket>>listenOn:
will produce a "primitive has failed" when doing Socket>>accept
or Socket>>waitAcceptFor:.
with 

Socket>>listenOn:backlogSize 

the problem disappears. I guess this is a BUG.



|stream str socket listener |
	listener _ Socket newTCP.
	listener listenOn: 8080 backlogSize:5.
	
[	[true]
		whileTrue:
		[
			socket _ listener waitForAcceptFor: 20000.
			(socket notNil and: [socket isConnected])
			ifTrue: [
				Transcript show: 'connected';cr.
				stream:=FGSocketStream new.
				stream setSocket:socket.
				str:='ein Test'.
				str do:[:e|
					stream nextPut:(e asInteger).
					Transcript show: e printString.
				].
				stream flush.
				socket _ nil
			]
			ifFalse: [Transcript show: 'not success']
		].
]forkAt:10.

-- 
Psssst! Mit GMX Handyrechnung senken: http://www.gmx.net/de/go/mail
100 FreeSMS/Monat (GMX TopMail), 50 (GMX ProMail), 10 (GMX FreeMail)



More information about the Squeak-dev mailing list