Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.46 KB

send.md

File metadata and controls

64 lines (45 loc) · 1.46 KB

Home

Function name : send

Group: Windows Sockets 2 (Winsock) - Library: ws2_32


The send function sends data on a connected socket.


Code examples:

Winsock: retrieving Web pages using sockets (HTTP, port 80)
Winsock: sending email messages (SMTP, port 25)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Winsock: reading email messages (POP3, port 110)
Winsock: connecting to a news server (NNTP, port 119)
A client for testing non-blocking Winsock server

Declaration:

int send(
  SOCKET s,
  const char* buf,
  int len,
  int flags
);  

FoxPro declaration:

DECLARE INTEGER send IN ws2_32;
	INTEGER   s,;
	STRING  @ buf,;
	INTEGER   buflen,;
	INTEGER   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.


Return value:

If no error occurs, send returns the total number of bytes sent, which can be less than the number indicated by len.