[Pharo-project] [Ocean] Simple client Tcp socket
Feb. 5, 2011
1:58 p.m.
Hi, Jannik asked for an example. I thought that it might interest others to test. So far, it does work only on Mac OS. 1) In a command line terminal evaluate the following echo "Hello from NetCat" | nc -l 1234 2) Then in a workspace evaluate this code. serverAddress := OCNIPV4SocketAddress loopbackAddressWithPort: 1234. socket := OCNTcpSocket new. socket isConnected. "---> false" socket connectToServer: serverAddress. socket isConnected. "---> true" socket send: 'Hello from Pharo'. Transcript cr; show: socket receive. socket destroy. socket isConnected. "---> false" That's all for now, Noury
5655
Age (days ago)
5655
Last active (days ago)
0 comments
1 participants
participants (1)
-
Noury Bouraqadi