13 lines
361 B
Plaintext
13 lines
361 B
Plaintext
var libsocket = @("lib","socket");
|
|
// connect
|
|
int socket = libsocket.connect("localhost",256);
|
|
// send data
|
|
{
|
|
sheet data = (sheet)"hello socket world";
|
|
int datalen = data.size();
|
|
int was = libsocket.send(socket,data,0,datalen);
|
|
// assuming here that all data has been sent (if not, send them in some loop)
|
|
}
|
|
// close socket
|
|
libsocket.close(socket);
|