SocketStream question

Mike Rutenberg mdrs at akasta.com
Thu Sep 4 11:17:00 UTC 2003


I am having troubles using Sockets and SocketStreams.  I am running this
with a up-to-date 3.6 VM and image under Windows.

Anyone know why I get a 'Connection closed while waiting for data.'
exception?  Is there anything wrong with this code?

Mike
-----------

	port _ 7357.
	listener _ Socket newTCP listenOn: port backlogSize: 5.
	sendStream _ SocketStream on:
		(Socket newTCP connectTo: NetNameResolver localHostAddress port: port).
	receiveStream _ SocketStream on: listener accept.

	text _ '12345678'.
	sendStream nextPutAll: text.
	sendStream close.
	(receiveStream upToEnd = text) ifFalse: [self halt].

	receiveStream close.
	listener close.



More information about the Squeak-dev mailing list