예제 #1
0
파일: Socket.cpp 프로젝트: crnt/x0
bool Socket::open(const SocketSpec& spec, int flags)
{
	if (spec.isLocal())
		return openUnix(spec.local, flags);
	else
		return openTcp(spec.address.str(), spec.port, flags);
}
예제 #2
0
bool ServerSocket::open(const SocketSpec& spec, int flags)
{
	if (spec.backlog() > 0)
		setBacklog(spec.backlog());

	if (spec.isLocal())
		return open(spec.local(), flags);
	else
		return open(spec.ipaddr().str(), spec.port(), flags);
}