[Tutorial] [Part 1] How to make a TCP server. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

[Tutorial] [Part 1] How to make a TCP server.

Since you've clicked here you're perhaps interested in what a TCP server is, and how to make one? I'll try keep things simple for you. If there is something you don't understand, try google or comment! First, what is TCP? TCP is a protocol used for sending data over the internet. There is two mainly used protocols for this, UDP and TCP. UDP just sends the message to the destination, where TCP checks if the server actually gets the message, and keeps them in the order they where sent. This is a slower process, but makes sure the messages are delivered. If you want to make games, you might want to check out the UDP protocol. Second, what can we do with a TCP server? Like any server, there are clients which can connect to the server and transmit data. You can basicly make something like Skype with this approach. Send messages, files, or whatever you can turn into a byte! Third, lets get to work! The way I've approached this is by seperating the project in three parts, three different classes. *Client* The client is what the users are going to use to connect to your server. *Server* This is what you are going to use for server managment. *ServerClient* This is what the server class uses to control each connected client. With this sorted out, the rest is very simple! (Article limit, read part two for next section!) ~ Frekvens1

24th Jul 2016, 10:25 PM
Thomas Alme
Thomas Alme - avatar
2 Answers
0
HTTPS://192.1 68.0.106:1200
14th Aug 2016, 11:46 AM
Hien Le
Hien Le - avatar
- 1
no
24th Nov 2016, 12:14 PM
melissa hurst
melissa hurst - avatar