Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 18, 2005, 2:21:30 PM (18 years ago)
Author:
rennerc
Message:

network_socket: uses now a thread to send

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_socket.h

    r5628 r5630  
    88#define _NETWORK_SOCKET
    99
     10//if you want to use outgoing buffer define _USE_OUTGOING_BUFFER
     11#define _USE_OUTGOING_BUFFER
     12
    1013#define _INCOMING_BUFFER_SIZE 10240
     14#define _OUTGOING_BUFFER_SIZE 302400
    1115#define _LOCAL_BUFFER_SIZE 1024
     16//sleep if incoming buffer is full
    1217#define _MSECONDS_SLEEP_FULL_BUFFER 10
     18//sleep if outgoing buffer is empty
     19#define _MSECONDS_SLEEP_EMPTY_BUFFER 10
    1320
    1421/* contains memmove and memcpy */
     
    3643//  UDPsocket udpSocket;
    3744
    38   byte buf[_INCOMING_BUFFER_SIZE];
    39   int bufferlength;
     45  byte incomingBuffer[_INCOMING_BUFFER_SIZE];
     46#ifdef _USE_OUTGOING_BUFFER
     47  byte outgoingBuffer[_OUTGOING_BUFFER_SIZE];
     48#endif
     49  int incomingBufferLength;
     50#ifdef _USE_OUTGOING_BUFFER
     51  int outgoingBufferLength;
     52#endif
    4053
    41   SDL_mutex * mutex;
    42   SDL_mutex * socketmutex;
     54  SDL_mutex * incomingBufferMutex;
     55#ifdef _USE_OUTGOING_BUFFER
     56  SDL_mutex * outgoingBufferMutex;
     57#endif
     58  SDL_mutex * socketMutex;
    4359  bool terminateThread;
    4460
    4561  static int thread_listen(void * data);
    4662  static int thread_read(void * data);
     63#ifdef _USE_OUTGOING_BUFFER
     64  static int thread_write(void * data);
     65#endif
     66
     67  bool _isListening;
    4768
    4869public:
Note: See TracChangeset for help on using the changeset viewer.