Problem in sending data through Socket in Pocket PC

G

Guest

Hi,

I've an application that is using socket connection over TCP/IP for sending
data from Pocket PC to a server. Well whenever the data size is on or below
58-59 kb all the data is send succesfully from Pocket PC to server. But when
the data is around 70-80 KB , it seems that the client application has send
the data from its end but the data never reaches the server. I'm using the
following lines to send data:


private Socket client;
byte[] data;
client = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp );
IPEndPoint endPt=new IPEndPoint(IPAddress.Parse(serverIP),portNo);
client.Connect(endPt);
LingerOption lingerOption = new LingerOption (true, 1);
client.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger,
lingerOption);

client.Send(data);

Even I'm not receiving any exception due to socket connection failure, etc;

Any tip/ suggestion regarding the solution would be very helpful.

Thanks
 
P

Paul G. Tobey [eMVP]

What medium is transmitting the data? Dial-up? ActiveSync? Wired
Ethernet? Wireless Ethernet?

What have you tried? Sending several pieces?

Paul T.
 
G

Guest

Hi Tobey,

We are sending the data through ActiveSync. And we tried to send the data in
one piece. Can you please tell me what is the maximum size of data packet
that can be transmitted over socket in one piece ? Is it 64 KB?

Thankx

Paul G. Tobey said:
What medium is transmitting the data? Dial-up? ActiveSync? Wired
Ethernet? Wireless Ethernet?

What have you tried? Sending several pieces?

Paul T.

Rahul Sur said:
Hi,

I've an application that is using socket connection over TCP/IP for
sending
data from Pocket PC to a server. Well whenever the data size is on or
below
58-59 kb all the data is send succesfully from Pocket PC to server. But
when
the data is around 70-80 KB , it seems that the client application has
send
the data from its end but the data never reaches the server. I'm using the
following lines to send data:


private Socket client;
byte[] data;
client = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp );
IPEndPoint endPt=new IPEndPoint(IPAddress.Parse(serverIP),portNo);
client.Connect(endPt);
LingerOption lingerOption = new LingerOption (true, 1);
client.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger,
lingerOption);

client.Send(data);

Even I'm not receiving any exception due to socket connection failure,
etc;

Any tip/ suggestion regarding the solution would be very helpful.

Thanks
 
P

Paul G. Tobey [eMVP]

No, I don't know enough about the internals of AS (and it probably varies
from version to version). It shouldn't matter, in my opinion, that you're
using AS, but, since it does, choose a size that will work with AS and
document why you did it...

Paul T.

Rahul Sur said:
Hi Tobey,

We are sending the data through ActiveSync. And we tried to send the data
in
one piece. Can you please tell me what is the maximum size of data packet
that can be transmitted over socket in one piece ? Is it 64 KB?

Thankx

Paul G. Tobey said:
What medium is transmitting the data? Dial-up? ActiveSync? Wired
Ethernet? Wireless Ethernet?

What have you tried? Sending several pieces?

Paul T.

Rahul Sur said:
Hi,

I've an application that is using socket connection over TCP/IP for
sending
data from Pocket PC to a server. Well whenever the data size is on or
below
58-59 kb all the data is send succesfully from Pocket PC to server. But
when
the data is around 70-80 KB , it seems that the client application has
send
the data from its end but the data never reaches the server. I'm using
the
following lines to send data:


private Socket client;
byte[] data;
client = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp );
IPEndPoint endPt=new IPEndPoint(IPAddress.Parse(serverIP),portNo);
client.Connect(endPt);
LingerOption lingerOption = new LingerOption (true, 1);
client.SetSocketOption (SocketOptionLevel.Socket,
SocketOptionName.Linger,
lingerOption);

client.Send(data);

Even I'm not receiving any exception due to socket connection failure,
etc;

Any tip/ suggestion regarding the solution would be very helpful.

Thanks
 
D

Dick Grier

Hi,

I agree with Paul.

However, there are some fundamental things about networks that may apply
here. A single TCP/IP packet is of variable length -- however, the maximum
size may be as small as 511 bytes (and will not be more than perhaps 2K).
AS tunnels TCP/IP packets, so it is reasonable to expect that a single
packet may have 511 bytes or fewer.

I often have optimized my software to assume this sort of packet size, and
have seen reasonable performance as a result.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top