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 - takkai

Pages: [1]
1
Yes it seems to work.
I was still asking because I'm ignorant about networking.

Thanks you very much for your help!

2
Network / Re: program stops with exit status 141, sf::TcpSocket::send()
« on: September 08, 2012, 07:18:22 pm »
Hi again,

so in hope to make my code work with a vanilla SFML 2.0, I've tryed this work around:

    sigset_t set;
    sigaddset(&set, SIGPIPE);
    int retcode = sigprocmask(SIG_BLOCK, &set, NULL);
    if (retcode == -1) error("sigprocmask");

please tell me if it's a good way to do this, and if not how I should do.

3
Network / Re: program stops with exit status 141, sf::TcpSocket::send()
« on: September 08, 2012, 05:54:21 pm »
OK, I understand.

So how should I handle this problem in the code I want to share?

4
Network / Re: Issue with simple Client/Server project
« on: September 08, 2012, 12:24:03 am »
I'm a beginner too with networking.
There's no precise question in your post, but what I can say is about the reserved port:
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
you're using 1700.
For what I have understood it's better using ports above 49151.
As it's a number difficult to remember, I'm using numbers bewteen 50000 and 65535.

5
Network / Re: program stops with exit status 141, sf::TcpSocket::send()
« on: September 08, 2012, 12:14:47 am »
Yes, indeed if I modify TcpSocket.cpp with this code (Linux) the behavior is what I expected.

So, what should I do if I plan to share my app in the future? Will 2.0 use the fix given in the issue? Or should I modify my code in some way to workaround the SIGPIPE?

6
Network / Re: program stops with exit status 141, sf::TcpSocket::send()
« on: September 07, 2012, 08:47:50 pm »
so with gdb:

Program received signal SIGPIPE, Broken pipe.
0xffffe430 in __kernel_vsyscall ()

(gdb) bt
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7edb8d1 in send () from /lib/i686/libc.so.6
#2  0xb7fdc11a in sf::TcpSocket::send(void const*, unsigned int) () from /temp/SFML_git/lib/libsfml-network.so.2
....

7
Network / Re: program stops with exit status 141, sf::TcpSocket::send()
« on: September 07, 2012, 07:15:59 pm »
I get the same problem in the client.

If the server was stopped (or crashed) the client just stops without any error message with the tcpSocket->send() call.

This call doesn't return any sf::Socket::Status that I could use, it just crashes the program without any error message and an exit code of 141.

8
Network / [SOLVED] program stops with exit status 141, sf::TcpSocket::send()
« on: September 07, 2012, 06:57:43 pm »
Hi,
in my tcp server my loop is like this

loop:
   r[] = receive clients
   ret = process r
   send clients ret
 

when the clients disconnect, they send a "I'm disconnecting" message to the server.
currently my server just ignores it (while I'm trying to make a game server that don't trust the client)
then when the server sends to the disconnected client, the server exits without any error message, only the returned status from the program $? being 141.

If I modify the clients to wait 2 seconds after sending their last message and before disconnecting the socket, then the server don't crash and continue to serve the other clients, because then it receives the status sf::Socket::Disconnected from the next socket->receive() call.

What did I make wrong?
How can I fix this?

(I'm using a recent git snapshot, 2012-08-20)
Thanks

Pages: [1]
anything