Hello Holla Forums

hello Holla Forums

i advanced C very much in last 2-3 months, i now want to start messing around with network programming, what do you recommend? What is most easiest C network library to learn? i just need to send simple text/numbers over network. Sockets are not easy i and dont have very much time.. SDL_net is not documented very well, what do you think?

Other urls found in this thread:

sfml-dev.org/documentation/2.4.1/group__network.php
beej.us/guide/bgnet/output/html/singlepage/bgnet.html
curl.haxx.se/libcurl/
twitter.com/SFWRedditVideos

Just use sockets and libevent if you need to handle a lot of concurrent connections.

i need client and server, client sends some numbers and server reads number and do some simple calculations and sends back, arent there any libs that do just that? and cross-platform is important too

What about SFML network library
sfml-dev.org/documentation/2.4.1/group__network.php

I've never done network programming and haven't touched C in a long time :^)

I think C isn't for you, user.

If you're still ready to be a big boy, read
beej.us/guide/bgnet/output/html/singlepage/bgnet.html

no C docs..

i guess i should check sockets...

btw can that code work on winshit? i want server on win machine

Do it the C way, #ifdef #else #endif should suffice.

Sockets aren't hard, quit being a baby. The hard part of network programming is getting used to how you communicate and checking the data you receive. You'll have to do that regardless because the data you receive cannot be trusted except in simple cases.

If you're working on Windows, Winsock follows (more or less) the Berkeley Sockets API, and so will help you with writing code that can be used anywhere. >>691651's link is good, so spend a day or two reading through it and working through your project while referencing it.

Other things to work on while working in C is figuring out how to do object oriented programming in C, since that's how the Sockets API is written. Since you mentioned simple things like text and numbers, sockets work fine and will give you an understanding of what goes on underneath the fancier libraries. Once you start sending more complex data structures, you'll have to work on ensuring you receive it correctly and it hasn't been modified in transport to become some invalid structure.

If I remember correctly there is section in beej guide that describes differences between UNIX amd Win sockets with description how to make things in guide work on Win.
Use tools like user in recommended if you want to code it in a way that allows you to run it on both Win and UNIX.
Also, if you are Win10 fag you could check out that Linux subsystem thing, that might allow you to do it UNIX way and run it on Win PC. Or you can install something like Cygwin.

Why not just use C++ at this point?

Off yourself.

Probably because Berkeley Sockets were introduced about the same time that C++ was.

Might also be because C's name mangling and data member organisation rules are very simple, whereas C++ has some caveats. But I'm gonna go with the release dates as the more likely candidate.

Erlang.

are you kidding? why?

wtf, i'm #justanotherperlhacker now

MPI.

It's fucking nothing. You might as well just use the Berkeley Sockets API.

it's not that difficult to open a tcp connection and send data...

/thread

Also that gif
my sides

Goto Rust, they say you can do anything better with them. If you're going to fuck up then do it in Rust.

Did I just come to understand why Rust was made? I like Rust now. Rust is my friend.

Stop.

If you're using a standard protocol, you can always try this:
curl.haxx.se/libcurl/
You could also do your socket stuff in Tcl. It's pretty easy to learn and designed from the start for embedding into C. It's useful for other stuff too, even GUI (Tk).

...