austin2162
2011-08-18 01:25:05
so i dived in to sockets to play with them but i cant figure them out can anyone help me with a server and client setup though sockets
edit: if this doesnt go here move it.
edit: if this doesnt go here move it.
2011-08-18 01:25:05
2011-08-18 02:08:51
From: austin2162
so i dived in to sockets to play with them but i cant figure them out can anyone help me with a server and client setup though sockets
edit: if this doesnt go here move it.
2011-08-18 02:12:57
2011-08-18 09:48:10
2011-08-18 12:36:35
2011-08-20 05:15:07
program new;
var sock: integer;
begin
sock := CreateSocket();
ConnectSocket(sock, 'localhost', '9001');
sendsocket(sock, 'hi'#10#13);
closesocket(sock);
end.
$ nc -l -p 9001 localhost
hi
program new;
var
serv, sock: integer;
s, ip, port:string;
begin
serv := CreateSocket();
setsockettimeout(serv, 50000);
BindSocket(serv, '0.0.0.0', '1504');
ListenSocket(serv);;
sock := AcceptSocket(serv);
setsockettimeout(sock, 50000);
writeln(recvsocketstr(sock));
end.
$ telnet localhost 1504
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HELO
Connection closed by foreign host.
Compiled succesfully in 100 ms.
HELO
Successfully executed.
2011-09-15 20:41:48