Re: Network Communications Information Missing From Docs

"[email protected]" <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
I posted a small TCP (and I suspect UDP) example a while ago, that works for me.

Assuming that the old 'legacy' daytime stream server runs on tcp port 13 (as an example).

$ gst daytime.st 
Loading package ObjectDumper
Loading package Sockets
'Sat Jun  6 10:30:16 2020'

As Derek indicated last june, the key issue is the namespace support.

The class below is Sockets.Socket where Sockets. is the package name and Socket the class name:

$ cat daytime.st 

Eval [

PackageLoader fileInPackage: 'Sockets'.

s _ Sockets.Socket remote:(Sockets.SocketAddress createLoopbackHost) port:13.
(s upTo: Character cr) printNl.
s close.

]

----- Op 5 jan 2021 om 20:06 schreef Gary Highberger [email protected]:

> Hi Paolo,
> 
> Thank you for the link. Im studying it now. Hmm. Tab complete doesn't work
> on the socket options I tried implying something is missing from my
> Smalltalk installation. Is the socket class included in the Ubuntu
> distribution of Smalltalk 3.2.5?
> 
> A link to a simple UDP message example would also be much appreciated.
> 
> Thanks again,
> Gary Highberger
> 
> On Mon, Jan 4, 2021 at 5:51 PM Paolo Bonzini <[email protected]> wrote:
> 
>> On 04/01/21 23:43, Gary Highberger wrote:
>> > information on Sockets programming appears to be missing from
>> > gnu-smalltalk-doc section 3.8. See below. if anybody knows where the
>> > information (UDP and TCP examples) on gnu-smalltalk sockets programming
>> is,
>> > please send me a link to it.
>>
>> You can find it at
>>
>> https://www.gnu.org/software/smalltalk/manual-libs/gst-libs.html#Sockets-package
>>
>> Paolo
>>
>> > 3.8 Sockets, WebServer, NetClients
>> > ==================================
>> >
>> > GNU Smalltalk includes an almost complete abstraction of the TCP, UDP
>> > and IP protocols.  Although based on the standard BSD sockets, this
>> > library provides facilities such as buffering and preemptive I/O which a
>> > C programmer usually has to implement manually.
>> >
>> >     The distribution includes a few tests (mostly loopback tests that
>> > demonstrate both client and server connection), which are class methods
>> > in 'Socket'.  This code should guide you in the process of creating and
>> > using both server and client sockets; after creation, sockets behave
>> > practically the same as standard Smalltalk streams, so you should not
>> > have particular problems.  For more information, refer to **note
>> > Network**programming with Sockets*: (gst-libs)Sockets.  The library is
>> > also used
>> > by many other packages, including Swazoo and the MySQL driver.
>> >
>> > -----Info: (gst)Network support, 26 lines
>> > --All-----------------------------------------------------
>> > Cannot find node 'Sockets'
>> >
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.