Nie mam aktualnie zainstalowanego GMa, ale to bardzo prosta rzecz:
Server:
GML (Create)
global.udpPortIn = 2401;
global.udpPortOut = 2402;
global.updSocketIn = udpconnect( global.udpPortIn, true ); // readable
global.updSocketOut = udpconnect( global.udpPortOut, true ); // writeable</span>
GML (SendMessage)
clearbuffer();
... // Some data to send
sendmessage( global.updSocketOut, global.clientIP[n], global.udpPortOut );
GML (ReceiveMessage)
recv = receivemessage( global.updSocketIn );
...
Client:
GML (Create)
global.udpPortIn = 2402; // Same as server's out port used by socket
global.udpPortOut = 2401; // Same as server's in port used by socket
global.updSocketIn = udpconnect( global.udpPortIn, true ); // readable
global.updSocketOut = udpconnect( global.udpPortOut, true ); // writeable</span>
GML (SendMessage)
clearbuffer();
... // Some data to send
sendmessage( global.updSocketOut, global.serverIP, global.udpPortOut );
GML (ReceiveMessage)
recv = receivemessage( global.updSocketIn );
...