Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 1.48 KB

closesocket.md

File metadata and controls

50 lines (37 loc) · 1.48 KB

Home

Function name : closesocket

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


The closesocket function closes an existing socket.


Code examples:

How to build UDP responder
Winsock: creating a socket that is bound to a specific service provider
Winsock: reading and setting socket options
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)
How to create non-blocking Winsock server
A client for testing non-blocking Winsock server

Declaration:

int closesocket(
  SOCKET s
);  

FoxPro declaration:

DECLARE INTEGER closesocket IN ws2_32;
	INTEGER s  

Parameters:

s [in] Descriptor identifying the socket to close.


Return value:

If no error occurs, closesocket returns zero. Otherwise, a value of SOCKET_ERROR (-1) is returned.