libutil++  1.9.3
 All Classes Functions Variables
TCPPort.cpp
1 /*
2 ** libutil++
3 ** $Id: TCPPort.cpp 1653 2016-02-28 19:54:59Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 static const char rcsid[] __attribute__((used)) = "$Id: TCPPort.cpp 1653 2016-02-28 19:54:59Z sella $";
10 
11 #include "TCPPort.h"
12 #include "PortException.h"
13 
14 #include <sys/socket.h>
15 #include <stdint.h>
16 
17 #include <string>
18 
19 using namespace sella::net;
20 
21 TCPPort::TCPPort(const std::string &service) throw (PortException) :
22  Port(service, Port::TCPRequired)
23 { }
24 
25 TCPPort::TCPPort(uint16_t port) throw (PortException) :
26  Port(port, Port::TCPRequired)
27 { }
28 
29 TCPPort::TCPPort(const TCPPort &other) throw () :
30  Port(other)
31 { }
32 
33 TCPPort::TCPPort(const TCPPort &&other) throw () :
34  Port(other)
35 { }
36 
37 TCPPort::~TCPPort() throw () { }
38 
39 const TCPPort::shared TCPPort::shared_ptr(const std::string &service) throw (PortException) {
40  return std::make_shared<TCPPort>(service);
41 }
42 
43 const TCPPort::shared TCPPort::shared_ptr(uint16_t port) throw (PortException) {
44  return std::make_shared<TCPPort>(port);
45 }
46 
47 /*
48 ** vim: noet ts=3 sw=3
49 */