How to do networking in Squeak?

Kwiyi Woo kwiyi at hotmail.com
Mon Feb 2 04:38:42 UTC 2004


Hello
I am trying to figure out how to do networking stuff in Squeak. I wrote a 
very simple code to create a listener at the specified port. But I don't 
know how to write back value so that the browser can display it. Could 
anyone please show me a very simple example so that I can leary from it.
Thanks
Kwiyi
___________________________________________________________________
start
	| socket listener |
	listener _ Socket newTCP.
	listener listenOn: 8080.
	[true]
		whileTrue:
		[socket _ listener waitForAcceptFor: 20.
		(socket notNil and: [socket isConnected])
		ifTrue: [Transcript show: 'hello World'.
		socket _ nil]
		ifFalse: [Transcript show: 'not success']].
___________________________________________________________________

_________________________________________________________________
Check out the coupons and bargains on MSN Offers! 
http://shopping.msn.com/softcontent/softcontent.aspx?scmId=1418




More information about the Squeak-dev mailing list