2009-05-08 20:15:53 +02:00
|
|
|
#ifndef _SOCKET_CLIENT_H
|
|
|
|
#define _SOCKET_CLIENT_H
|
|
|
|
|
|
|
|
#include "../../../frameworks/base/include/utils/List.h"
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
class SocketClient {
|
|
|
|
int mSocket;
|
|
|
|
pthread_mutex_t mWriteMutex;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SocketClient(int sock);
|
|
|
|
virtual ~SocketClient() {}
|
|
|
|
|
|
|
|
int getSocket() { return mSocket; }
|
|
|
|
|
2009-05-12 20:16:59 +02:00
|
|
|
int sendMsg(int code, char *msg, bool addErrno);
|
2009-05-08 20:15:53 +02:00
|
|
|
int sendMsg(char *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef android::List<SocketClient *> SocketClientCollection;
|
|
|
|
#endif
|