Changeset 5987 in orxonox.OLD for branches/network/src/lib/network/network_socket.h
- Timestamp:
- Dec 8, 2005, 8:13:22 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_socket.h
r5829 r5987 18 18 //sleep if outgoing buffer is empty 19 19 #define _MSECONDS_SLEEP_EMPTY_BUFFER 10 20 //sleep when waiting for connections 21 #define _MSECONDS_SLEEP_LISTEN 100 20 22 21 23 22 /* contains memmove and memcpy */ … … 64 63 bool terminateThread; 65 64 66 static int thread_listen(void * data);67 65 static int thread_read(void * data); 68 66 #ifdef _USE_OUTGOING_BUFFER … … 70 68 #endif 71 69 72 bool _isListening; 70 int writeBytes(byte * data, int length); 71 int readBytes(byte * data, int length); 72 int readBlock(byte * data, int length); 73 74 void init(); 73 75 74 76 public: … … 76 78 NetworkSocket(); 77 79 NetworkSocket(IPaddress ip); 80 NetworkSocket(TCPsocket sock); 78 81 ~NetworkSocket(); 79 82 80 83 void connectToServer(IPaddress ip); 81 void listen(unsigned int port);82 84 void disconnectServer(); 83 int writeBytes(byte * data, int length);84 int readBytes(byte * data, int length);85 int readBlock(byte * data, int length);86 85 87 private: 88 void init();86 bool writePacket(byte * data, int length); 87 int readPacket(byte * data, int maxLength); 89 88 90 89 };
Note: See TracChangeset
for help on using the changeset viewer.