summaryrefslogtreecommitdiffstats
path: root/include/sysutils/SocketClient.h
blob: cde64a542d8e5a3d3e0014bdc5559b4606a763a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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; }

    int sendMsg(int code, char *msg, bool addErrno);
    int sendMsg(char *msg);
};

typedef android::List<SocketClient *> SocketClientCollection;
#endif