00001 // ===================================================================== 00021 // ===================================================================== 00022 #ifndef __TOBJECTSOCKET_HH 00023 #define __TOBJECTSOCKET_HH 00024 00025 #include "Tglobals.h" 00026 00027 00047 class TObjectSocket 00048 { 00049 00050 protected: 00051 enum { tDefaultPortNumber = 18150 }; 00052 00053 protected: 00054 Tint theServerDescriptor; 00055 Tint thePortNumber; 00056 struct sockaddr_in theAddress; 00057 00058 public: 00059 TObjectSocket( Tint portnumber ); 00060 00061 protected: 00062 virtual ~TObjectSocket(); 00063 00064 public: 00065 Tint GetServerDescriptor() const; 00066 Tint GetPortNumber() const; 00067 00068 public: 00069 Tint OpenServer(); 00070 Tint CloseServer(); 00071 00072 }; 00073 00074 inline Tint TObjectSocket::GetServerDescriptor() const 00075 { 00076 return theServerDescriptor; 00077 } 00078 00079 inline Tint TObjectSocket::GetPortNumber() const 00080 { 00081 return thePortNumber; 00082 } 00083 00084 #endif