I am trying to receive and send with a UDP socket, but it never works.. I can either just send, or receive. I have tried non blocking, I have tried more than one thread.. It just seems that I can only send and receive if I use 2 sockets..? Any input on this? :c
if I have a loop like so:
while(running)
{
receive();
sendAPacket();
}
and receive is like so:
sf::Socket::Status socketStatus = recvSocket.Receive(recvPacket, serverIP, port);
if(socketStatus == sf::Socket::Done)
{
if(recvPacket >> receivePacket)
{
}
}
}
No packets will be received by the server, whether the socket is blocking or not....... if I comment out receive, the server gets all packets.. but the client no longer can receive...
What is happening!??!
Should I switch to something else? I really enjoy the whole packet thing though :|!