-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSocketNotifier.h
More file actions
43 lines (33 loc) · 812 Bytes
/
SocketNotifier.h
File metadata and controls
43 lines (33 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// SocketNotifier.h
// MessageLoop
//
// Created by Lymons on 14-3-20.
// Copyright (c) 2014年 Lymons. All rights reserved.
//
#ifndef __MessageLoop__SocketNotifier__
#define __MessageLoop__SocketNotifier__
#include <iostream>
#include <sys/socket.h>
#include "Notifier.h"
class Handler;
class Socket;
class SocketNotifier : public Notifier<SocketNotifier>
{
friend class Notifier<SocketNotifier>;
protected:
SocketNotifier();
~SocketNotifier();
public:
int CreateServer() ;
int CreateClient(Handler* h);
void DestoryServer(int id);
void DestoryClient(int id);
bool SendMessage(int id, void* m);
void* RecvMessage(int id);
void StartMonitor();
private:
private:
Socket* _socket;
};
#endif /* defined(__MessageLoop__SocketNotifier__) */