UDPSocket::UDPSocket(const string &localAddress, unsigned short localPort)
     throw(SocketException) : CommunicatingSocket(SOCK_DGRAM, IPPROTO_UDP) {
  setLocalAddressAndPort(localAddress, localPort);
  setBroadcast();
}
示例#2
0
文件: socket.cpp 项目: alyst/zorba
TCPServerSocket::TCPServerSocket(const std::string &localAddress, 
    unsigned short localPort, int queueLen): Socket(SOCK_STREAM, IPPROTO_TCP) {
  setLocalAddressAndPort(localAddress, localPort);
  setListen(queueLen);
}
示例#3
0
ServerSocket::ServerSocket() : GenericSocket(SOCK_STREAM, IPPROTO_TCP){
    setLocalAddressAndPort("127.0.0.1", DEFAULT_LISTEN_PORT);
}