How do you know from wich ip an udp packet is comming from?
Posted on 2001-12-09 09:33:25 by dxantos
When you connect to a server or accept a connection, a sockaddr structure is set or returned that contains the IP you are/have connected to. Is that what you mean?

Posted on 2001-12-09 09:43:14 by Thomas

arent udp comms connectionless? dxantos should use the sockaddr struc he pass to recvfrom(), i think


int recvfrom (
char FAR* buf,
int len,
int flags,
[COLOR=red]struct sockaddr FAR* from,[/COLOR]
int FAR* fromlen

Posted on 2001-12-09 15:00:45 by ancev
ancev: you're right, I never actually used UDP but the docs say that connect can be used to set the default destination address for subsequent recv(from) functions... But your code will work I think..

Posted on 2001-12-09 15:17:01 by Thomas
Sorry for my ignorance. Im new to network programming. :)

Since UDP is conectionless, is there a way to prevent a DOS attack?
Posted on 2001-12-10 08:42:31 by dxantos
I guess you could put very restrictive filters in a router very early
in your network, where the OC256 line enters your company... ;).
Posted on 2001-12-10 09:24:27 by f0dder