Today's Smalltalk 4 You looks at setting up a socket based listener in VA Smalltalk. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
You can also watch it on YouTube:
Today we'll again look at using sockets for basic communication in VA Smalltalk. This time, we'll set up the socket server in VA Smalltalk, and have VW Smalltalk interact with that. To get started, load the TCP support into VA:
That loads in the basic support we need. Here's the VA code to run:
"In VA" sock := AbtSocketStream openAsServerOnHost: 'localhost' port: 8001. sock2 := sock accept. buffer :- sock2 next: 23. Transcript show: buffer; cr. sock close. "Once that's running, In VisualWorks" SocketAccessor exampleIPClient.
Once you have the VA side running, try the VW code. You should see the following in the Transcript in VA:
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
[st4u254-iPhone.m4v ( Size: 2781484 )]