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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Daffern

Pages: [1]
1
Network / Latency
« on: March 02, 2014, 02:55:34 pm »
Hi everyone. Im currently trying to make a multiplayer action game, and i figured it would be a good thing to measure latency somehow in order to place bulllets for example. Is there a way to measure latency in sfml?

2
Network / Blocking/unblocking sockets
« on: July 16, 2013, 07:35:51 pm »
I have been trying to set up a tcp and udp network, and i want to use nonblocking sockets. However i noticed that when i'm using nonblocking sockets the return code for udpSocket.bind() and tcpSocket.connect() doesnt return sf::Socket::Done even if the operation was successful. My workaround was doing this:

tcpSocket.setBlocking(true);
if (tcpSocket.connect(ip,port, sf::seconds(3) ) != sf::TcpSocket::Done){
   std::cout<<"Failed to connect TCP"<<std::endl;
   tcpSocket.setBlocking(false);
}

Is this intended and is this a good or a bad way to do it?

EDIT: tcpSocket.receive() also returns sf::Socket::Done when it doesn't receive anything in nonblocking mode

Pages: [1]