Jump to content

Server Programming?

Hi P
Go to solution Solved by phoenixflower,

There definitely seem to be a lot of answers that come from a good place in this post but may find themselves a little bit overwhelming to someone new to the server space.

 

If you want the coding "Hello World" of servers

 

https://www.geeksforgeeks.org/socket-programming-cc/ (it's very crude by illustrates the point).  It's the simplest client/server model in which the client and server are physically located on the same machine.

 

A lot of the above answers make an assumption that you either have a background in networking or understand what networking can be used for.

 

 

 

Eli is great at taking what I would describe as super hard topics and breaking them down into core points.

 

If you wanted an actual C++ example and not just a C example as posted above https://www.boost.org/doc/libs/1_68_0/doc/html/boost_asio/examples/cpp11_examples.html

 

https://www.boost.org/doc/libs/1_70_0/libs/beast/doc/html/beast/examples.html

 

C++20 will bring a lot of that into the core library, but you'll have to wait a little bit

 

I recommend watching Eli's tutorials before moving onto the C++ examples as you'll probably need some of the background.  I hope this helps you :)

I'd like to learn about servers, but I don't know where to begin, I tried googling it and I got different answers which got me confused 

 

Could someone point me towards the right path? pretty much: what's the "Hello World" equivalent of servers?

 

My first goal is to have a desktop application interact with a server, to gather and store data, like an inventory, the application would be done in C++ if that matters :)

 

Thank you

 

Link to comment
Share on other sites

Link to post
Share on other sites

What server? A web server? A database server? A game server? A virtualization server? A file/media/print server?

What protocols do you intend to use?

HAL9000: AMD Ryzen 9 3900x | Noctua NH-D15 chromax.black | 32 GB Corsair Vengeance LPX DDR4 3200 MHz | Asus X570 Prime Pro | ASUS TUF 3080 Ti | 1 TB Samsung 970 Evo Plus + 1 TB Crucial MX500 + 6 TB WD RED | Corsair HX1000 | be quiet Pure Base 500DX | LG 34UM95 34" 3440x1440

Hydrogen server: Intel i3-10100 | Cryorig M9i | 64 GB Crucial Ballistix 3200MHz DDR4 | Gigabyte B560M-DS3H | 33 TB of storage | Fractal Design Define R5 | unRAID 6.9.2

Carbon server: Fujitsu PRIMERGY RX100 S7p | Xeon E3-1230 v2 | 16 GB DDR3 ECC | 60 GB Corsair SSD & 250 GB Samsung 850 Pro | Intel i340-T4 | ESXi 6.5.1

Big Mac cluster: 2x Raspberry Pi 2 Model B | 1x Raspberry Pi 3 Model B | 2x Raspberry Pi 3 Model B+

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Hi P said:

Could someone point me towards the right path? pretty much: what's the "Hello World" equivalent of servers?

This is a pretty broad question to ask, unfortunately. Technically you could achieve this by connecting a serial cable to two computers and having one listen on it and responding back to the other's inputs. But I doubt that's what you really want.

 

Figure out what you want the server to do first, then we can narrow down on what you want.

Edited by Mira Yurizaki
Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, jj9987 said:

What server? A web server? A database server? A game server? A virtualization server? A file/media/print server?

What protocols do you intend to use?

I have no idea, that's the problem, I have zero knowledge regarding servers so I want to learn, I dont even know what protocols are.

 

By the sound of it, might be the database server I guess :)

 

4 hours ago, Mira Yurizaki said:

This is a pretty broad question to ask, unfortunately.

 

Figure out what you want the server to do first, then we can narrow down on what you want.

Thank you, the issue is I have zero knowledge on the topic, so I don't even know what server do I need :(

 

I just want to learn how to setup a server to store information about an inventory (for example, an imaginary shop), and have my desktop program store and gather information from said server

 

I remember I did this back in highschool, so I thought it may be the first step, but I dont really know

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Hi P said:

I dont even know what protocols are

That would be networking not servers.

 

As people have said you really need to really think about what exactly the area is you are interested in.

 

What you have asked is the same as going I want to learn science.

 

Is that physics, biology, chemistry, astrophysics, quantum mechanics.

 

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, vorticalbox said:

As people have said you really need to really think about what exactly the area is you are interested in.

I googled "server types" and I believe it would be  a database, by the description of it :)

 

Link to comment
Share on other sites

Link to post
Share on other sites

What do you want to accomplish? If it's just to get an application to send/retrieve structured data to/from a server, probably the easiest thing would be just to make an HTTP server and use the JSON protocol to pass data around, that's how a good chunk (dare-say majority) of API servers in the world operate. You can accomplish and learn a lot with just that. If you want to just "start somewhere", that is a good place to start.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Hi P said:

 

I just want to learn how to setup a server to store information about an inventory (for example, an imaginary shop), and have my desktop program store and gather information from said server

  

 

A basic database and CRUD (create/read/update/delete) app is what you want. Use those keywords with a language of your choice and you will find loads of tutorials. 

Intel 11700K - Gigabyte 3080 Ti- Gigabyte Z590 Aorus Pro - Sabrent Rocket NVME - Corsair 16GB DDR4

Link to comment
Share on other sites

Link to post
Share on other sites

It depends what you want to do with the server, whether it's game server hosting, or something like web/database hosting.

Link to comment
Share on other sites

Link to post
Share on other sites

There definitely seem to be a lot of answers that come from a good place in this post but may find themselves a little bit overwhelming to someone new to the server space.

 

If you want the coding "Hello World" of servers

 

https://www.geeksforgeeks.org/socket-programming-cc/ (it's very crude by illustrates the point).  It's the simplest client/server model in which the client and server are physically located on the same machine.

 

A lot of the above answers make an assumption that you either have a background in networking or understand what networking can be used for.

 

 

 

Eli is great at taking what I would describe as super hard topics and breaking them down into core points.

 

If you wanted an actual C++ example and not just a C example as posted above https://www.boost.org/doc/libs/1_68_0/doc/html/boost_asio/examples/cpp11_examples.html

 

https://www.boost.org/doc/libs/1_70_0/libs/beast/doc/html/beast/examples.html

 

C++20 will bring a lot of that into the core library, but you'll have to wait a little bit

 

I recommend watching Eli's tutorials before moving onto the C++ examples as you'll probably need some of the background.  I hope this helps you :)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×