|
Open Model Railroad Network (OpenMRN)
|
Go to the source code of this file.
Classes | |
| class | SocketListener |
| TCP server. More... | |
Functions | |
| int | ConnectSocket (const char *host, int port) |
| Connects a tcp socket to the specified remote host:port. | |
| int | ConnectSocket (const char *host, const char *port_str) |
| Connects a tcp socket to the specified remote host:port. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Interface for listening to a socket and delivering a callback for each incoming connection.
Definition in file socket_listener.hxx.
| int ConnectSocket | ( | const char * | host, |
| const char * | port_str | ||
| ) |
Connects a tcp socket to the specified remote host:port.
Returns -1 if unsuccessful; returns the fd if successful.
| host | hostname to connect to. Shall be null for mDNS target. |
| port | TCP port number or mDNS hostname to connect to. |
| int ConnectSocket | ( | const char * | host, |
| int | port | ||
| ) |
Connects a tcp socket to the specified remote host:port.
Returns -1 if unsuccessful; returns the fd if successful.
| host | hostname to connect to |
| port | TCP port number to connect to |