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

Pages: [1]
1
Network / Re: SFML TCP Receive Locks on invalid data.
« on: May 25, 2014, 12:12:37 am »
Thanks for the information, I was able to resolve the issue I was having by using a buffer for the buffer that reads the length data sfml prepends to the packets and waits for all data etc.

2
Network / Re: SFML TCP Receive Locks on invalid data.
« on: May 24, 2014, 08:57:12 pm »
I see, well is that a general issue with receiving them directly into packet? Or something I am doing wrong?

Both client and server will use sf sockets, but I have to consider any other problems that will arise if say a user sends a malformed packet.  In this case it locks up.

3
Network / SFML TCP Receive Locks on invalid data.
« on: May 24, 2014, 07:55:10 pm »
I am working with the 2.1 code found at the following URL: ( http://www.sfml-dev.org/documentation/2.1/classsf_1_1SocketSelector.php ).

Using the code verbatim, I have ran into the following issue.

When you connect with any client, telnet for example, and simply type one letter the packet gets sent and since its the wrong format for SFML the client locks up on

if (client.receive(packet) == sf::Socket::Done)

I know I can receive into a byte array instead of directly into a packet, but I wanted to use this method to deal with packet fragmentation (When I tested it without SFML the server is sending packets over TCP and splitting them randomly and breaking things). 

I cannot have a potential connection block the whole server because they send a little invalid data.

Any advice would be great.

Best Regards.

4
Network / Re: Question about using packets without sfml network.
« on: May 02, 2014, 11:25:46 pm »
What about sf::Packet::append() and getData()/getDataSize()?

And instead of saying "it's not an option", it would be nice to know why.

Thank you, I overlooked ::append it seems, it will for fill my needs exactly.

5
Network / Re: Question about using packets without sfml network.
« on: May 02, 2014, 06:06:16 pm »
You can easily convert between char arrays and std::string, so just use strings in your packet.

Thank you, but simply using strings is not an option.

6
Network / Question about using packets without sfml network.
« on: May 02, 2014, 01:32:01 am »
Hello, I am currently charged with making an update to an existing server program, and I wanted to use sf::Packets to handle some of the data.  Currently the application receives data in a char array, all I wanted to know was how to change a char array so that it fits with a sf::Packet so that I can use rPacket >> data >> data2 etc.

I was able to already modify the server to send the packets with packet.getdata() / packet.getdatasize(), it is just casting the existing received packet into a sf::packet.

Thanks.

Pages: [1]