/* * The Unix Channel * * by Michel Beaudouin-Lafon * * Copyright 1990-1993 * Laboratoire de Recherche en Informatique (LRI) * * Port server : client side * * $Id$ * $CurLog$ */ #ifndef PortServer_H_ #define PortServer_H_ #include "Socket.h" #include "ccu/String.h" class UchDatagram; typedef int (* PortServMatchFun) (const char*, lword, sword, const char*); class UchPortServer { protected: UchDatagram* Serv; CcuString Name; public: UchPortServer (const char*, const char* = 0); ~UchPortServer (); void Register (const char*, UchInetAddress&, int = 0); void Remove (const char*, UchInetAddress&, int = 0); UchInetAddress* Inquire (const char*, int = 10); int Match (const char*, PortServMatchFun, int = 10); void Dump (); void Quit (); char* MakeKey (const char*); }; extern void PortServerRegister (const char*, const char*, UchInetAddress&); extern void PortServerRemove (const char*, const char*, UchInetAddress&); inline void PortServerRegister (const char* s, const char* h, UchAddress* a) { PortServerRegister (s, h, * ((UchInetAddress*) a)); } inline void PortServerRemove (const char* s, const char* h, UchAddress* a) { PortServerRemove (s, h, * ((UchInetAddress*) a)); } extern UchInetAddress* PortServerInquire (const char*, const char*, const char* = 0); #endif /* PortServer_H_ */