help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Re: Using Sockets


From: Stephen
Subject: Re: [Help-smalltalk] Re: Using Sockets
Date: Sun, 26 Dec 2010 12:15:19 +1300
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

Hi Aidan,

If you have a mailserver running locally, here is some simple sockets code to access the response from it.

$ cat gst31_sockettest.st
#!/usr/bin/gst -f
       PackageLoader fileInPackage: 'NetClients'.
       s := Sockets.Socket remote: '127.0.0.1' port: 25.
       (s upTo: Character cr) printNl.
       s close.

$ gst gst31_sockettest.st
"Global garbage collection... done"
Loading package Sockets
Loading package SUnit
Loading package NetClients
'220 mailserver.ourdomain.com ESMTP Postfix'

Regards
Stephen
On 24/12/10 10:24 PM, Aidan Gauland wrote:
Aidan Gauland<aidalgol<at>  no8wireless.co.nz>  writes:
gnu-smalltalk-el from sid did not load properly, so I chose to build
GST 3.2.3.  My socket code no longer crashes gst.  Thank you very
much!

Claimed victory too soon.  It doesn't crash, but I have no idea what
I'm doing.  I think I once figured out how to create send a string
over a TCP connection in Squeak, but I hadn't a clue what I was doing.
I was just hacking Smalltalk in highschool when I was bored.  I've
done a little with sockets in C, but only going through tutorials.

Could someone please give me an example of using Sockets in Smalltalk
for client-side stuff (or better yet, put it on the wiki)?  There are
a few decent *server* examples on the wiki, but no Smalltalk client as
counterparts for them.

--Aidan

P.S. I ultimately want to write an IRC bot in Smalltalk, because I
don't much fancy the available IRC bots and the languages for which
IRC libraries are available.



_______________________________________________
help-smalltalk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-smalltalk






reply via email to

[Prev in Thread] Current Thread [Next in Thread]