?
Solved

Sendto-Receivefrom buffer size in blocking mode ?

Posted on 1997-06-18
4
Medium Priority
?
708 Views
Last Modified: 2013-12-23
Hi all,

I'm working with winsock api (wsock32.dll), in UDP blocking mode. First, it seems you cannot receive a buffer more than 30 000 bytes, although you can send correctly the same buffer, "sendto()" returns Ok after sending 30 000 bytes but the distant host who have made an "receivefrom()" is always in the blocking mode. Second, even if the distant host can receive 20 000 bytes buffer size, sometimes to time, the host is blocked again on "receivefrom()".

Can you explain this ? What are the limits of winsock ?

Thank you
0
Comment
Question by:mars
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:jdunlop
ID: 1545284
It seems to me you'd be better off asking this
in a programming area. (If this was linked to
from a programming area, I apologize).
0
 
LVL 3

Accepted Solution

by:
hpierson earned 400 total points
ID: 1545285
When you do a WSAStartup, a WSAData structure is returned that show many of the specifics of the local winsock. You may want to examine it.

Also, be aware that there a re application buffers as well as system network buffers. Just because your application can send a large buffer, it doesn't mean that the entire message is going in a single packet.

Quoting from Windows Sockets Network Programming by Bob Quinn (ISBN 0-201-63372-8 Published by Addison Wesley - my single best source of Winsock information) you should think in terms of MTU - maximum Transmittable Units. (pg 430)

"On UDP,  it is possible to send any size datagram, and IP handles fragmentation and reassembly. This is not advisable, however for a number of reason....worst of all, if the local or remote network-systems do not have adequate buffer space availalabe the operation may fail _without an error_, since datagrams  are unreliable."

"We recommend using no more than 1460 (bytes) for TCP and 1472 for UDP. These match the MTU sizes of...and are a common value for the negotiated MSS. This maximizes efficiency for the common case."

Read this book - it is full of practical as well as theoretical information.


Harry M. Pierson
DREJ Consulting
0
 

Author Comment

by:mars
ID: 1545286
you confirm the facts, yes, i known the size of data in a single packet form 46 bytes to about 1500, but i come from unix world and the winsock (TCP/IP) interface does not work like in unix.
My question is : What is the network interface used by Windows  to exchange file between hosts for instance ? Does it use UDP with less than 1500 bytes per packet ? I want it to known because windows send very fastly large buffer.
0
 
LVL 3

Expert Comment

by:hpierson
ID: 1545287
My understading is that the Client for Microsoft Networks uses NetBeui, even if you have other protocols installed. If so, this is what is used for all file transfer.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question