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.


Messages - EiTkoCaT

Pages: [1] 2 3 4
1
Network / Apache and mail server - delay of UDP?
« on: September 18, 2011, 05:37:53 pm »
I'm running Apache2 and mail server, and in the same server a game server that gets and sends UDP and TCP packets. I have a big delay on the packets. When I'm running on a different server on the same place and also in my computer, no delay at all. Is the apache2 and the mail makes the dekay? Why?

2
Network / Best Way To Handle Thousands of UDP packets in a second
« on: September 16, 2011, 06:02:30 pm »
Hey,

I have fixed that and it's still not working well. All the packets are coming but in a delay of 10 seconds. What should I do?

3
Network / 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;
}
}
}

4
Network / Best Way To Handle Thousands of UDP packets in a second
« on: September 13, 2011, 04:10:28 pm »
Ok, so I'll just create one thread that listens to the UDP.

But do you think that would solve the problem? What do you think about what I wrote on my last post?


Thanks.

5
Network / Best Way To Handle Thousands of UDP packets in a second
« on: September 13, 2011, 03:41:57 pm »
Yes, currently it is like that. The TCP thread is kind of most, but I think I will have one thread for the UDP which is a selector.

The problem is the CPU. I'm not using, not even close to maximuum network traffic. But I'm using 250% CPU. I have 400%.

So would that solve my problem - Using the UDP selector? Somethings to notice: The TCP messages are answered very fast, while the UDP can come in a delay of 10 seconds. Not milliseconds. Maybe I should do 2 programs running? One TCP and the second only UDP updates on-the-game? IT is possible.

Thanks a lot.

6
Network / Best Way To Handle Thousands of UDP packets in a second
« on: September 13, 2011, 03:14:26 pm »
I'm using boost thread for each client connected via TCP and I'm opening another thread which binds to UDP. The TCP works perfect but I have a big delay on the UDP messages answers. What am I doing wrong? Should I use UDP selector? The packets must be answered immediately, it's a real-time game.

7
Network / Best Way To Handle Thousands of UDP packets in a second
« on: September 13, 2011, 02:49:13 pm »
Hey,


I need to handle from each client 30 packets per second. I have like 500 clients connected in the same time. I need to get a packet, process it and give an answer. What would be the best way to do that? Selector? SFML Threads? Boost Threads?

Thanks.

8
Network / UDP are delayed. Linux settings?
« on: September 10, 2011, 08:26:47 pm »
I'm having some lags with my server running Ubuntu 10.04 on my UDP packets. What should I do to change the settings set for the UDP packets? I think the problem is there.

On my /proc/sys/net/ipv4/udp_mem I have 137088   182784   274176
udp_rmem_min: 4096
udp_wmem_min: 4096


/proc/sys/net/core/rmem_max - 131071
/proc/sys/net/core/rmem_default - 124928

/proc/sys/net/core/wmem_max - 131071
/proc/sys/net/core/wmem_default - 124928

9
Network / Checking client ping
« on: August 21, 2011, 07:03:50 pm »
Hey,

Can I check the client's ping with the server? You know, this millie second thing.

Thanks.

10
Network / Problem when client is diconnecting
« on: August 20, 2011, 10:52:00 am »
Code: [Select]
int main() {

sf::SocketTCP Listener;
if (!Listener.Listen(4567))
{
    cout << "error listening" << endl;
}


sf::IPAddress ClientAddress;
sf::SocketTCP Client;
if (Listener.Accept(Client, &ClientAddress) != sf::Socket::Done)
{
bool CountinewWithPlayer = 1;
while (CountinewWithPlayer)
{
  std::size_t Receiveda = 0;
  sf::Socket::Status status;
  char MessageLivea[25600];
  cout << "2" << endl;
  status = (Client.Receive(MessageLivea, sizeof(MessageLivea), Receiveda));
  cout << "3" << endl;
  if ( status  != sf::Socket::Done)
  {
     cout << "disonnected" << endl;
     CountinewWithPlayer = 0;
  }
   
}

}

return 0;
}

11
Network / Problem when client is diconnecting
« on: August 20, 2011, 01:36:21 am »
OK Here's my full code:

Code: [Select]
CountinewWithPlayer = 1;
while (CountinewWithPlayer)
{
std::size_t Receiveda = 0;
sf::Socket::Status status;
char MessageLivea[25600];
cout << "2" << endl;
status = (Client.Receive(MessageLivea, sizeof(MessageLivea), Receiveda));
cout << "3" << endl;
if ( status  != sf::Socket::Done)
{
cout << "disonnected" << endl;
CountinewWithPlayer = 0;
}

}


If I just close the client program, it's ok, disconnected. If lost connection on client, it prints 1, 2, but not 3, and not disconnecting the player. Why is that happening?


Thanks!

12
Network / Problem when client is diconnecting
« on: August 20, 2011, 12:57:57 am »
OK I found out that it happens when ever I send, not Receive.. That's really weird...

13
Network / Problem when client is diconnecting
« on: August 19, 2011, 12:47:26 pm »
Hey,

My server is using SFML c++ for TCP connections. If a user closes the client program, the server needs to know that he is now disconnected. Whenever I close the program in the client, the server does says that the client disconnected. But if the client lost connection or something, and did disconnected from the server, the server still sees him as connected. Why is that happening? My check is always:
status = (Client.Receive(MessageLivea, sizeof(MessageLivea), Receiveda));
if ( status  != sf::Socket::Done)
{
cout << "disonnected" << endl;
} else ....

14
Network / Multiple UDP Clients
« on: July 11, 2011, 12:49:39 am »
OK so I've figured that I've got to bind to port 0 on the client, but how can I know what port to send in the server?

Thanks!

15
Network / Multiple UDP Clients
« on: July 10, 2011, 07:45:58 pm »
OK so I have a problem - in my server I'm sending and getting UDP packets from clients, but if I tried 2 clients using the same IP (same router),it ends up with 1 client getting the packets of both of them. How can I solve that?

Pages: [1] 2 3 4