![]() |
Accept() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: TCPSocket.h |
BOOL Accept( CTCPSocket* tSok);
Accept a connection, supply an already made socket
try { //Quit if not ok if (!CheckSocketValid()) return FALSE; //First accept the socket SOCKET sok; //Where we are connected to sockaddr_in saConnected; //Size of the structure int iTmp; iTmp=sizeof(saConnected); //Accept it sok=accept(GetHandle(),(sockaddr*)&saConnected,&iTmp); if (sok!=INVALID_SOCKET) { //Set the socket data tSok->m_ConnectedTo=saConnected; tSok->AssignSocket(sok); tSok->Accepted(); return TRUE; } else { //Error SetLastError("Accept"); return FALSE; } } ERROR_HANDLER_RETURN("Accept",FALSE)
![]() |
Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 24 Apr 2001. |