|
simple server?: msg#00061lang.smalltalk.squeak.beginners
I'm trying to learn to write network objects in squeak. I read the chapter "Networking Squeak" by Parsia, Kerimbaev, and Spoon, from Mark Guzdials book. But I wanted to start at a more basic level. My first attempt is to write the simplest possible server. This server should wait for a connection, then print the first line sent to it, finally close. Unfortunately, it gets a "primitive failed" error. I got the same result on XP and Vista. Here's my code: | serverSocket connectionSocket | Socket initializeNetwork. serverSocket := Socket newTCP. serverSocket listenOn: 8080. connectionSocket := serverSocket accept. Transcript show: (connectionSocket upToAll: String crlf). connectionSocket close. serverSocket close. I found some old code for the PWS and looked around. It makes a ServerSocket object, but I can't find that class in my image (3.9-7067). If I do get a server socket to return a connection socket, is there a way to convert that socket into a SocketStream? Can anyone get me un-stuck? I've been trying to get past this for a couple evenings now. Thanks much, Don
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re[3]: [UI] chang tab font in a flap ?, work open |
|---|---|
| Next by Date: | Re: simple server?, Michael van der Gulik |
| Previous by Thread: | Re: Re[3]: [UI] chang tab font in a flap ?, work open |
| Next by Thread: | Re: simple server?, Michael van der Gulik |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |