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?
Just use sockets and libevent if you need to handle a lot of concurrent connections.
Nathaniel Brooks
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
btw can that code work on winshit? i want server on win machine
Ayden Adams
Do it the C way, #ifdef #else #endif should suffice.
John Hall
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.
Jeremiah Cruz
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.
Andrew Bell
Why not just use C++ at this point?
Luke Gutierrez
Off yourself.
Luke Howard
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.
Mason Hughes
Erlang.
Jordan Clark
are you kidding? why?
Isaac Russell
wtf, i'm #justanotherperlhacker now
Michael Rogers
MPI.
Kayden Davis
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...
Jacob Flores
/thread
Also that gif my sides
William Gray
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.
Jordan Gonzalez
Stop.
Brandon Garcia
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).