Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: UDP Packet is never "Done" on Linux?  (Read 2729 times)

0 Members and 1 Guest are viewing this topic.

EiTkoCaT

  • Newbie
  • *
  • Posts: 47
    • View Profile
UDP Packet is never "Done" on Linux?
« on: September 16, 2011, 11:10:55 am »
Hey,

As I've learned in http://www.sfml-dev.org/forum/viewtopic.php?t=5852 I need to have one boost thread for the UDP packets. And I did it. On my computer it works perfect, but on my Ubuntu 10.04 it always returns that the socket is not ready. It's not a problem with the client and I'm sure about that. The socket is not blocking, also on blocking it's not working. What's the problem here? Here's some code:

Code: [Select]
void UDPUser () {
int countIt = 0;
sf::SocketUDP Socket;
if (!Socket.Bind(2435))
{
   // Error...
cout << "ERROR 97" << endl;

}

//Client.SetBlocking( false );
Socket.SetBlocking( false );
cout << "listen" << endl;

while(true) {
char Buffer[128];
std::size_t Received;
sf::IPAddress Sender;
unsigned short Port;
if (Socket.Receive(Buffer, sizeof(Buffer), Received, Sender, Port) != sf::Socket::Done)
{
// Error...
cout << "error 107" << endl;

//return;
} else {
cout << "gpt" << endl;
}
}
}