Uhm, guys I really appreciate that I can use IPv6 but:

Yesterday I spent some time trying to open a socket given that I know
the IP address and the port. The lack of documentation or suggested
types sure wasn't helpful and I wished Pharo was statically typed so
that I at least knew what I had to pass in.

That's what I came up with:

hostIP := (SocketAddressInformation forHost: anIpString service: ''
    flags: 0
    addressFamily: SocketAddressInformation addressFamilyINET4
    socketType: SocketAddressInformation socketTypeStream
    protocol: SocketAddressInformation protocolTCP) first socketAddress.
socket := Socket new.
socket connectTo: hostIP port: portNumber.

There's gotta be a better way to do this.

The whole API with arrays where you have to know the index, ByteArray
objects, integer flags and so forth seems like a blast from the past.

Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to