JimmyL Posted July 11, 2006 Share Posted July 11, 2006 Hi, I'm having a little trouble with opening multiple sockets. On a client ds, I have a udp socket talking to a server ds, while that's happening I want to open a tcp socket, connect to a server and send a packet. When I do this, it seems that the udp socket becomes invalid, which wouldn't be much of a problem if the client wasn't behind a router(or had port forwarding turned on), since I could recreate a udp socket and the server would continue sending to the old addr/port(I'm doing this workaround now on the server machines and it works fine). Any clue what I could be doing wrong? or if there's a bug in the libs? Thanks,Jimmy Link to comment Share on other sites More sharing options...
sgstair Posted July 11, 2006 Share Posted July 11, 2006 Well, I know for a fact that creating multiple sockets isn't a problem, and the process to create a UDP or TCP socket is quite nearly identical, so it's unlikely that's your problem.It's very unlikely that your problem is that the udp socket is becoming invalid, it is more likely a polling problem or some sort of stupid mistake :\ I'd check to be 100% sure you're not overwriting your socket handle with the TCP one, or doing anything else similarly silly. Other than that, I'm not sure - but I'm pretty sure it's not the lib's fault. -Stephen Link to comment Share on other sites More sharing options...
JimmyL Posted July 12, 2006 Author Share Posted July 12, 2006 Ok, good to know you don't think it's in the lib. I'll search through my code on the weekend to see if I can find something. Knowing me, I probably left a variable uninitialized or something... and as a sidetrack which I should probably open a new thread for, but does your lib support broadcast sockets/packets? on the pc I would call setsockopt( BroadcastSock, SOL_SOCKET, SO_BROADCAST, ... but setsockopt in your lib is set to just return 0. Jimmy Link to comment Share on other sites More sharing options...
sgstair Posted July 13, 2006 Share Posted July 13, 2006 not via setsockopt, but broadcast addresses should work. -Stephen Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now