Skip to content

Commit 4e75647

Browse files
author
Amanda Butler
authored
Merge pull request #319 from deepikabhavnani/tcp_server
Updated TCP Sever doc
2 parents 28eaaed + 215c929 commit 4e75647

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/reference/api/connectivity/networksocket/TCPServer.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
The TCPServer class provides the ability to accept incoming TCP connections. The `listen` member function sets up the server to listen for incoming connections, and the `accept` member function sets up a stateful TCPSocket instance on an incoming connection.
44

5+
The constructor takes in the NetworkStack pointer to open the socket on the specified NetworkInterface. If you do not pass the NetworkStack pointer in the constructor, then you must call open to initialize the socket.
6+
7+
Refer to [TCPSocket](/docs/v5.6/reference/tcpsocket.html) class for TCP `connect`, `send` and `recv` APIs.
8+
59
### TCPServer class reference
610

711
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/v5.6/mbed-os-api-doxy/class_t_c_p_server.html)
12+
13+
### TCPServer example
14+
15+
Here is a TCP server example. It accepts single telnet client connection and sends buffer data.
16+
17+
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/mbed-os-example-tcp-server/)](https://os.mbed.com/teams/mbed_example/code/mbed-os-example-tcp-server/file/ddb5698aa782/main.cpp)

0 commit comments

Comments
 (0)