File: socketlistener.h

package info (click to toggle)
dc-qt 0.2.0.alpha-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,936 kB
  • ctags: 5,361
  • sloc: cpp: 28,936; makefile: 19
file content (26 lines) | stat: -rw-r--r-- 605 bytes parent folder | download | duplicates (4)
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
#ifndef RPCSOCKETLISTENER_H
#define RPCSOCKETLISTENER_H


namespace rpc {
	
class Socket;
	
/**
	@author Rikard Bjorklind <olof@linux.nu>
*/
class SocketListener{
public:
	virtual ~SocketListener() {}
	virtual void onRead(Socket*) = 0;
//	virtual void onWrite(Socket*) = 0;
	//! Called as soon as a connection is established. Do not do anything important in this method, especially dont do anything with the socket emitting it!
	virtual void onConnect(Socket*) = 0;
	virtual void onDisconnect(Socket*) = 0;
	virtual void onIncoming(Socket*) {} // not pure since we only use it for servers.

};

}

#endif