Board index » Visual Studio » Why, Who can tell why occcurred this?

Why, Who can tell why occcurred this?

Visual Studio82
Hi, Everyone ,

My friend is writting socket program base on windows socket class (MFC

provide). There is a problem has confuse me serval days. When i send data

throught socket over 800k per time at the client part, i receive those data

at server port . the problem has appeared . I can not receive all the data,

Only a few data have been received . Why ? who can tell me why? Does the

windows socket support sending a larger data through it? If it does not

support sending larger data , you can tell me the how much data can be sent

throught windows socket class . How to slove this problem ? Does anyone have

some solution to this problem ? Thanks.





Mixtrue


-
 

Re:Why, Who can tell why occcurred this?

mixtrue wrote:

Quote


Hi, Everyone ,

My friend is writting socket program base on windows socket class (MFC

provide). There is a problem has confuse me serval days. When i send data

throught socket over 800k per time at the client part, i receive those data

at server port . the problem has appeared . I can not receive all the data,

Only a few data have been received . Why ? who can tell me why? Does the

windows socket support sending a larger data through it? If it does not

support sending larger data , you can tell me the how much data can be sent

throught windows socket class . How to slove this problem ? Does anyone have

some solution to this problem ? Thanks.



Mixtrue



GetSockOpt(SO_SNDBUF,...) and SetSockOpt(SO_SNDBUF,...) can check and

set the internal winsock buffer size.



The number of bytes received per Receive call is often not related to

the number of bytes sent per send call: This is typical of sockets and

requires that you reassemble messages in a buffer at the receive end.



--

Scott McPhillips [VC++ MVP]

-