10#if !defined(OWL_WSKSERVM_H)
14#if defined(BI_HAS_PRAGMA_ONCE)
28#define WINSOCK_NOERROR (int)0
29#define WINSOCK_ERROR (int)SOCKET_ERROR
34#define N_MAX_SERVICE_NAME 128
35#define MSG_SERVICE_NOTIFY ((UINT)(WM_USER+302))
89 const char* szProtocol = 0);
93 int GetServiceAsync(HANDLE& hService,
char* szName,
const char* szProtocol = 0);
Encapsulates information about a service.
TServiceEntry()
Initializes all data members of servent to 0.
The TServiceManager class (and its friend class TServiceWindow) encapsulate the Winsock database func...
HANDLE LastServiceRequest
Handle of last service request.
bool LastServiceRequestCompleted
Is the last request done?
friend class TServiceWindow
int GetLastServiceCompletion()
This function returns the last service completion.
int GetServiceName(uint16 nPort, char *szName, const char *szProtocol=0)
This function is blocking.
int GetServiceAsync(HANDLE &hService, uint16 nPort, const char *szProtocol=0)
This call is non-blocking.
int GetServicePort(char *szName, uint16 &nPort, const char *szProtocol=0)
This function is blocking.
TServiceWindow Window
Private window for catching notification.
void ServiceCompleted(int nError)
This function is called whenever an internal window callback is used for an asynchronous call.
int GetService(TServiceEntry *&sEntry, uint16 nPort, const char *szProtocol=0)
Implements the blocking getservbyport().
TServiceManager()
This function creates the hidden window and initializes data members.
int GetLastError()
This function returns the last error code.
bool GetServiceRequestCompleted()
This function returns true if the last service requested has been completed.
int CancelServiceRequest(HANDLE hService=0)
This function cancels a pending service that equals the hService.
char ServiceBuffer[MAXGETHOSTSTRUCT]
Used for calls to WSAAsync...().
int OutstandingServiceRequests
Count of total requests done by myself that haven't completed yet.
int LastError
Last error code.
TServiceManager * ServiceManagerParent
Object to pass notifications.
TResult DoNotification(TParam1, TParam2)
This function merely calls the parent notification function.
DECLARE_RESPONSE_TABLE(TServiceWindow)
TServiceWindow(TServiceManager *newServiceManagerParent)
A TServiceWindow requires a TServiceManager parent.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
Object Windows Library (OWLNext Core).
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
LRESULT TResult
Result type.
General definitions used by all ObjectWindows programs.
Base window class TWindow definition, including HWND encapsulation.
Main header of the Winsock OWL subsystem.
#define MSG_SERVICE_NOTIFY