aboutsummaryrefslogtreecommitdiff
path: root/src/serversocket.h
blob: 9a26e2d3e28e47156391d87065ae9c087252f909 (plain)
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
#ifndef SERVER_SOCKET_H
#define SERVER_SOCKET_H

#include <stdint.h>
#include "fstring.h"
#include "socket.h"

namespace Bu
{
	/**
	 *
	 */
	class ServerSocket
	{
	public:
		ServerSocket( int nPort, int nPoolSize=40 );
		ServerSocket( const FString &sAddr, int nPort, int nPoolSize=40 );
		virtual ~ServerSocket();

		int accept( int nTimeoutSec, int nTimeoutUSec );

	private:
		void startServer( struct sockaddr_in &name, int nPoolSize );

		fd_set fdActive;
		int nServer;
		int nPort;
	};
}

#endif