Hi all,
i’ve been working on TCP server and client socket classes that wrap SDL C functions in a way that is more convenient for me. This all went well with nice OnRead() ect. event handlers.
However i’ve been looking into the UDP side of the coin now,… and came to the conclusion that there is no way to reuse a socket for UDP sending ( you pass destination address each time ).
So am i correct in assuming that on a UDP ‘client’ you can send but not recieve or does Net2 miss some functionality ?. if so does this mean that for bidirectional communication i will need both a UDP ‘client’ socket and a UDP ‘server’ listen socket.
Tnx for any help.
DV.
Hi all,
i’ve been working on TCP server and client socket classes that wrap
SDL C functions in a way that is more convenient for me. This all
went well with nice OnRead() ect. event handlers. However i’ve been
looking into the UDP side of the coin now,… and came to the
conclusion that there is no way to reuse a socket for UDP sending (
you pass destination address each time ). So am i correct in
assuming that on a UDP ‘client’ you can send but not recieve or does
Net2 miss some functionality ?. if so does this mean that for
bidirectional communication i will need both a UDP ‘client’ socket
and a UDP ‘server’ listen socket.
Tnx for any help.
DV.
Yes you will. Need a Server… and then send over it’s socket.
if you want look in my BomberClone Source there is the udp.c file…
this is what i use for the udp communication.
http://stpohle.bei.t-online.de/bomberclone
bye bye for now… i hope this source will help you.
Steffen.On Tue, 18 Feb 2003 13:05:59 +0100 “Dinand Vanvelzen” wrote:
–
Steffen Pohle (@Steffen_Pohle)
http://stpohle.bei.t-online.de
JabberID: stpohle at amessage.de
ICQ: 370965 Yahoo: stpohle
MSN: stpohle at hotmail.com
I dont know about SDL NET, but with straight-up sockets, you dont need 2 UDP
sockets on each end for bi-directional communication. You see, when the
client sends info to the server, the server uses recvfrom() (as opposed to
the regular recv() for TCP), and recvfrom() has more paramaters that tell
the person recving where the data came from. that way, you can send stuff
back to the client, over the same UDP sockets. 
i dont know if that’ll help you at all with sdl net, but, o well. just to
tell ya that its possible
m@_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail