I need some noob-friendly network library. One that would do most of hard stuff like making connection and resending UDP packets if it is UDP connection, leaving only sending actual network messages to programmer.
So I could write (in pseudocode) something similar to this:
Code:
TCPconnection:=connect_tcp(ip_or_url,port);
UDPconnection:=connect_udp(ip_or_url,port2);
SendString_tcp("Hai, I'm TCP packet!");
SendString_udp("Hai, I'm UDP packet!");
closeTCP(TCPconnection);
closeUDP(UDPconnection);
and from server side
Code:
TCPconnection:=connect_tcp(ip_or_url,port);
UDPconnection:=connect_udp(ip_or_url,port2);
while (tcpPacketsInQueue(TCPConnection)) do begin
packet:=GetTCPPacket;
writeln(packet.value);
end;
while (udpPacketsInQueue(UDPConnection)) do begin
packet:=GetUDPPacket;
writeln(packet.value); //packet.value would be variant.
end;
closeTCP(TCPconnection);
closeUDP(UDPconnection);
Bookmarks