Re: [Dev-C++] Sockets API - Newbie - send() function
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel K. O. <dan...@ya...> - 2004-11-08 07:13:46
|
Peter Dennis wrote: > sent = send( datasock, string, strlen( string ), 0); > > I understand the first 3 parameters but can someone tell me what the > '0' is as the fourth parameter to the send function? (it is probably > a flag but what does it do? does it mean there are no flags?) You can find Winsock documentation at MSDN; you can also Google for a .hlp/.chm help file for off-line reference. This is from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/send_2.asp : --- int send( SOCKET s, const char* buf, int len, int flags ); Parameters s [in] Descriptor identifying a connected socket. buf [in] Buffer containing the data to be transmitted. len [in] Length of the data in buf, in bytes. flags [in] Indicator specifying the way in which the call is made. (...) The flags parameter can be used to influence the behavior of the function beyond the options specified for the associated socket. The semantics of this function are determined by the socket options and the flags parameter. The latter is constructed by using the bitwise OR operator with any of the following values. MSG_DONTROUTE Specifies that the data should not be subject to routing. A Windows Sockets service provider can choose to ignore this flag. MSG_OOB Sends OOB data (stream-style socket such as SOCK_STREAM only. --- Daniel K. O. |