|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello Group,
Recently I came across this question asked to me. Is there any flag you can set so that you are allowed to send more data on the socket in the calls to sentto/send, than the internal socket buffer can handle. Is there any way. And if there is no way then what is a way out. Thanks for your . nagrik |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <1177112559.470678.217590@d57g2000hsg.googlegroups .com>,
Vinay Nagrik <jainarunk@gmail.com> wrote: > Hello Group, > > Recently I came across this question asked to me. > > Is there any flag you can set so that you are allowed to send more > data on the socket in the calls to sentto/send, than the internal > socket buffer can handle. If you could, where would it put it? If it's a UDP socket, and you want it to just drop the data, I think you could do this by setting the socket to non-blocking mode. The call to send/sendto would report the error EWOULDBLOCK, and you can choose what to do with the packet you were trying to send. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
In article <barmar-987B2D.20252721042007@comcast.dca.giganews.com>,
Barry Margolin <barmar@alum.mit.edu> wrote: >> Is there any flag you can set so that you are allowed to send more >> data on the socket in the calls to sentto/send, than the internal >> socket buffer can handle. >If it's a UDP socket, and you want it to just drop the data, I think you >could do this by setting the socket to non-blocking mode. The call to >send/sendto would report the error EWOULDBLOCK, and you can choose what >to do with the packet you were trying to send. Whether that makes any sense depends on which flavor of sockets is involved. In the flavor I feel most comfortable with, whether you use a non-blocking socket or not, sendto() does not block if you call it too often. 4.*BSD style sendto() instead fails with ENOBUFS. To see if someone had changed things when I wasn't looking, I just now tested sending to port 9 from a FreeBSD 6.2 system. See http://www.google.com/search?q=enobufs Vernon Schryver vjs@rhyolite.com |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Apr 20, 4:42 pm, Vinay Nagrik <jainar...@gmail.com> wrote:
> Hello Group, > > Recently I came across this question asked to me. > > Is there any flag you can set so that you are allowed to send more > data on the socket in the calls to sentto/send, than the internal > socket buffer can handle. > > Is there any way. And if there is no way then what is a way out. What is the problem? If you need to send more data than the buffer can hold, send the data later. If you literally have no place to put the data, either discard it or disconnect the client as is appropriate for the network protocol you are using. DS |
|
![]() |
| Outils de la discussion | |
|
|