Need help on Network programming

goran.krampe at bluefish.se goran.krampe at bluefish.se
Fri Mar 18 07:04:14 UTC 2005


Hi!

First - could you change your email client settings? It sends emails
encoded like this:
> Content-Type: text/plain; charset="gb2312"
> Content-Transfer-Encoding: base64

...and that is really uncommon. :)

Anyway, some help:

> Hi,everyone:
>
> I'm exploring the Network programming in Squeak. But I cannot find any tutorials on it. 

Well, I am not sure but I vaguely recollect some stuff possibly being in
any of the two Squeak books, they are available here (and tons of other
free really good Smalltalk books):

	http://www.iam.unibe.ch/~ducasse/FreeBooks.html

> I tried to view the source directly of the classes like Socket. And then I made a simple socket server, but when it's got connected, a "primitive failed" error always comes up. I don't know why it happens.

We need to see your code to help more specifically with your error.
Otherwise it is like saying "my computer goes beep, why?" :) "primitive
failed" is a very, very generic error message.

> Could you please give me some information about it?

Not without more info, but I can give you some hints about network
programming. :)

You very seldom need to use Socket directly - SocketStream is a nicer
wrapper for it and typically all you need if you want to write a client.

If you want to build a server there are multiple ways of doing that, and
there are multiple packages on SqueakMap that you can look at to see how
it can be done. Some code uses ConnectionQueue and other packages, like
KomHttpServer, uses KomServices which has a class called TcpService that
you can subclass to write your own server.

If you only want to communicate between Squeak processes (and not
actually messing around on the Socket leve) then you can use more high
level packages, like for example:

http://map1.squeakfoundation.org/sm/packagebyname/remotemessaging
http://map1.squeakfoundation.org/sm/packagebyname/soaporb
http://map1.squeakfoundation.org/sm/packagebyname/maclientserver
http://map1.squeakfoundation.org/sm/packagebyname/rst

...and probably a bunch more. :) Also use IRC, irc.freenode.net, channel
#squeak. There is often help to get there.

> Thank you very much.
>
> --- ShiningRay

regards, Göran



More information about the Squeak-dev mailing list