views:

26

answers:

1

Has anyone tried to do a tcp client server app using the emulator using the pc as a server and the phone as the client?

I've got a bit of an issue where its only sending one packet, ie 1491 bytes of data regardless of how much there actually is to send, from the client(Phone) to the server(PC)

Thanks

James

A: 

1491 looks like it's related to the MTU (the maximum packet size supported by a protocol). The ethernet MTU is 1500.

Artelius
Yeah that's exactly what it is, but it's the fact that the server only ever receives one packet. Meaning that if you try and send say 2k's worth off data from the client to the server it won't get all of it. I know that this an emulator issue because if I install the app on my phone it works fine. But developing solely on a physical device is a bit of pain.CheersJames
jpspringall
@jpspringall How are you determining you only receive 1 packet ? In your code, or by sniffing the network ?
nos
In my code, no matter how much i send from the emulator to the pc in one go, i only every get 1491 bytes. I was presuming that it was setting somewhere in the emulator setup, but i guess not
jpspringall
Maybe there's something wrong with your code. Why don't you show some of the code you are using?
Artelius
Im asking how you "get" those 1491 bytes ? you call read() once? In a loop ? Something else ?
nos