MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / SetAsyncNotify

Method SetAsyncNotify

UTCP/src/ut_clnt.cpp:2269–2295  ·  view source on GitHub ↗

SetAsyncNotify Sets which functions that will have an async notification if used. Param events - FD_READ FD_WRITE FD_OOB FD_ACCEPT FD_CONNECT FD_CLOSE (one or more of the above) Return UTE_SUCCESS - success UTE_ERROR - error ****************************************************/

Source from the content-addressed store, hash-verified

2267 UTE_ERROR - error
2268****************************************************/
2269int CUT_WSClient::SetAsyncNotify(long events){
2270
2271 int iResult;
2272
2273 if (m_socket != INVALID_SOCKET)
2274 iResult = WSAAsyncSelect(m_socket,m_hAsyncWnd,CUT_ASYNC_NOTIFY_MSG,events);
2275 else if (m_serverSocket != INVALID_SOCKET)
2276 iResult = WSAAsyncSelect(m_serverSocket,m_hAsyncWnd,CUT_ASYNC_NOTIFY_MSG,events);
2277 else
2278 {
2279 return OnError(UTE_ERROR); // Call on of the socket creating functions
2280 // before calling SetAsyncNotify().
2281 }
2282
2283 if(iResult == SOCKET_ERROR)
2284 return OnError(UTE_ERROR);
2285
2286 // Changes !!! AG 14 April 99 !!!
2287 // Call to WSAAsyncSelect function automatically set a
2288 // socket to nonblocking mode. To set the socket back to
2289 // blocking mode, an application must first disable
2290 // WSAAsyncSelect by calling WSAAsyncSelect with the events
2291 // parameter equal to zero.
2292 m_nBlockingMode = CUT_NONBLOCKING;
2293
2294 return OnError(UTE_SUCCESS);
2295}
2296/***************************************************
2297AsyncGetNameFromAddress
2298 Async version of GetNameFromAddress.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected