SocketFactory implementation that is used to create Sockets.
More...
#include <src/main/decaf/internal/net/DefaultSocketFactory.h>
|
| | DefaultSocketFactory () |
| virtual | ~DefaultSocketFactory () |
| virtual decaf::net::Socket * | createSocket () |
| | Creates an unconnected Socket object.- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if the Socket cannot be created. |
|
| virtual decaf::net::Socket * | createSocket (const decaf::net::InetAddress *host, int port) |
| | Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.- Parameters
-
| host | The host to connect the socket to. |
| port | The port on the remote host to connect to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
|
| virtual decaf::net::Socket * | createSocket (const decaf::net::InetAddress *host, int port, const decaf::net::InetAddress *ifAddress, int localPort) |
| | Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.The Socket will be bound to the specified local address and port.- Parameters
-
| host | The host to connect the socket to. |
| port | The port on the remote host to connect to. |
| ifAddress | The address on the local machine to bind the Socket to. |
| localPort | The local port to bind the Socket to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
|
| virtual decaf::net::Socket * | createSocket (const std::string &name, int port) |
| | Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.- Parameters
-
| host | The host name or IP address to connect the socket to. |
| port | The port on the remote host to connect to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
|
| virtual decaf::net::Socket * | createSocket (const std::string &name, int port, const decaf::net::InetAddress *ifAddress, int localPort) |
| | Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.- Parameters
-
| host | The host name or IP address to connect the socket to. |
| port | The port on the remote host to connect to. |
| ifAddress | The address on the local machine to bind the Socket to. |
| localPort | The local port to bind the Socket to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
|
| virtual | ~SocketFactory () |
SocketFactory implementation that is used to create Sockets.
- Since
- 1.0
◆ DefaultSocketFactory()
| decaf::internal::net::DefaultSocketFactory::DefaultSocketFactory |
( |
| ) |
|
◆ ~DefaultSocketFactory()
| virtual decaf::internal::net::DefaultSocketFactory::~DefaultSocketFactory |
( |
| ) |
|
|
virtual |
◆ createSocket() [1/5]
◆ createSocket() [2/5]
Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.
- Parameters
-
| host | The host to connect the socket to. |
| port | The port on the remote host to connect to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
Implements decaf::net::SocketFactory.
◆ createSocket() [3/5]
Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.The Socket will be bound to the specified local address and port.
- Parameters
-
| host | The host to connect the socket to. |
| port | The port on the remote host to connect to. |
| ifAddress | The address on the local machine to bind the Socket to. |
| localPort | The local port to bind the Socket to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
Implements decaf::net::SocketFactory.
◆ createSocket() [4/5]
| virtual decaf::net::Socket * decaf::internal::net::DefaultSocketFactory::createSocket |
( |
const std::string & | name, |
|
|
int | port ) |
|
virtual |
Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.
- Parameters
-
| host | The host name or IP address to connect the socket to. |
| port | The port on the remote host to connect to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
Implements decaf::net::SocketFactory.
◆ createSocket() [5/5]
Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.
- Parameters
-
| host | The host name or IP address to connect the socket to. |
| port | The port on the remote host to connect to. |
| ifAddress | The address on the local machine to bind the Socket to. |
| localPort | The local port to bind the Socket to. |
- Returns
- a new Socket object, caller must free this object when done.
- Exceptions
-
| IOException | if an I/O error occurs while creating the Socket object. |
| UnknownHostException | if the host name is not known. |
Implements decaf::net::SocketFactory.
The documentation for this class was generated from the following file: