Jump to content

Troubles sending data


PadrinatoR

Recommended Posts

Hi!!

 

I'm writing a Pictionary game for DS and now I'm trying to send images to the server in order to resend them to the other consoles. The drawing area size is: 221x153 so I'm trying to send 33813 bytes, 33,02KB. I send it in only one packet but I receive two packets in my server app: one of 4260bytes and other of 3991bytes.

 

I'm using normal TCP connection and DSWifi 0.3b. What can be the problem?

 

Thanks in advance.

 

See ya!

Edited by PadrinatoR
Link to comment
Share on other sites

Hiya, well, there are some things you really should know about TCP;

Firstly, you should not treat it as a packeted format, it's a stream format, so the only requirement is that bytes come out of the "pipe" on the destination side in the same order that they were put in on the source.

Additionally though, you're not checking the return value of the "send" function, as it returns the number of bytes that have been sent, you must call the function again with the remaining data if the returned value does not match the size of the data you are trying to send.

 

-Stephen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...