Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Flags in send() and recv() function SOCKETS Posted by bpajk on 17 Oct 2003 at 5:00 AM
What do the flags in the send() and recv() mean, when and how can I use them. I allways use 0 as a flag parameter.
Here is the reference:

15 Recv
Declaration
Function Recv (Sock:Longint;Var Addr;AddrLen,Flags:Longint) : Longint;

Description
Recv reads at most Addrlen bytes from socket Sock into address Addr. The socket must be in a connected state. Flags can be one of the following:
1
: Process out-of band data.
4
: Bypass routing, use a direct interface.
??
: Wait for full request or report an error.
The functions returns the number of bytes actually read from the socket, or -1 if a detectable error occurred.
Report
Re: Flags in send() and recv() function SOCKETS Posted by Manning on 17 Oct 2003 at 4:29 PM
: What do the flags in the send() and recv() mean, when and how can I use them. I allways use 0 as a flag parameter.

It's largely protocol dependant, this is just what I know with TCP. With both send() and recv() you can use the MSG_OOB flag, which is most commonly used to send "urgent" data. On recv() you can also use the MSG_PEEK flag which will read the incoming data, but not remove it from the buffer.

If you look on MSDN you might find some other options as well.
Report
Re: Flags in send() and recv() function SOCKETS Posted by bpajk on 20 Oct 2003 at 7:20 AM
Thanx, that realy helped me a lot.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.