User:RossyMiles/Flatline: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 33: Line 33:
Destroys a UDP socket created with NetUDPSocket_Create.
Destroys a UDP socket created with NetUDPSocket_Create.


bool '''NetUDPSocket_Send('''int '''socket''', sockaddr_in/sockaddr_in6 '''address''', const char* '''data''', uint16_t '''datalen)'''<br>
bool '''NetUDPSocket_Send('''int '''socket''', sockaddr* '''address''', const char* '''data''', uint16_t '''datalen)'''<br>
Sends a packet of data to the specified address using the specified socket. To broadcast a message across a LAN (such as when checking for available games), send it to 255.255.255.255 (IPv4 only).
Sends a packet of data to the specified address using the specified socket. To broadcast a message across a LAN (such as when checking for available games), send it to 255.255.255.255 (IPv4 only).


Line 45: Line 45:
Starts a new UDP server on the specified port which calls '''packet_callback''' when a packet is recieved. Does not return until the server has finished running ('''packet_callback''' returns false).
Starts a new UDP server on the specified port which calls '''packet_callback''' when a packet is recieved. Does not return until the server has finished running ('''packet_callback''' returns false).


bool '''NetUDPServer_Send('''sockaddr_in/sockaddr_in6 '''address''', const char* '''data''', uint16_t '''datalen)'''<br>
bool '''NetUDPServer_Send('''sockaddr* '''address''', const char* '''data''', uint16_t '''datalen)'''<br>
Sends a packet of data to the specified address using the server running on the current thread. This function should only be called from '''packet_callback''' or functions called by '''packet_callback'''.
Sends a packet of data to the specified address using the server running on the current thread. This function should only be called from '''packet_callback''' or functions called by '''packet_callback'''.
98

edits