Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Good day, I just want to ask some help about connecting to a device using TCP/IP and how to properly read() and write() command to it.
Any sample codes or references would be a very big help. I don't have any idea in this particular matter but I have some knowledge in C programming and serial ports.
By the way, I'm currently using ubuntu. Thanks
I do not know what you mean by device (any device located in /dev?), but here is a tutorial on c sockets using write and read:
https://vcansimplify.wordpress.com/2013/03/14/c-socket-tutorial-echo-server/
If you would like to gain access to a device in /dev then you just need to open it like a file and also treat it like a file (read / write from it like you would from a file).
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to get access to analyzed packet layer information (that tshark does very well) in a C program.
Is there a library interface for tshark that can be used to gather analysis information from packets of a pcap file?
PS: Higher layer languages is not an option for me. I have it working with pyshark (Python) but is too slow for my need(pyshark invokes tshark command line and processes the response json). I need a way to directly get tshark output to my C program.
You probably will want libpcap for this, if I understand the question correctly.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Can you give me a simplest method to check the Internet availability using a C program in Linux?
I have implemented a program to run the system command 'traceroute' in C. Before this I have to check whether the Internet connection is available or not. So can you suggest a method?
Short answer: no. Neither C nor C++ has direct knowledge of networking, or any built-in networking functions.
Depending on what 3rd-party libraries you are using, there may be something you can use, but that depends on the library, it isn't directly part of C.
I can imagine there are libraries out there that might try to ping some internal/external address, perform a name lookup, etc. But if you're on an isolated network, not having the ability to ping, lookup, or cross a firewall to get to a certain location may be perfectly valid, and doesn't indicate a networking problem.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a client/server simple program in C. I want to test the server running on different machine with random inputs. I have looked at 'Bunny-the-fuzzer' but from what I can understand It wont be much help when the target program/application is on remote machine.
Can someone recommend me any other available tools for testing such network programs ?
Thanks
If it is still relevant there are numerous products that can fuzz network products, from open source tools like SPIKE and Peach to commercial fuzzers like beSTORM
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have a C/C++ server process that needs to broadcast data to some number of client programs on other computers. Client programs are also C/C++. I need a reliable and lightweight communication library that will allow my server to communicate with any number of clients. Clients must be able to detect when a socket connection is no longer open, hopefully without having to constantly poll the server. I do not want to use something huge like Boost. I want something lightweight and simple. Any ideas?
See the answer to this question. It looks like Qt may include what you need, and it's known as relatively simple to use. SDL.net is another alternative that might meet those requirements.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
can sum guide me to a link or a program for simple client and server c or c++ code to run on linux
The requirement is that should be able to send and receive messages.....
Beej's Guide to Network Programming - Using Internet Sockets is an excellent tutorial to understand sockets and connections. Plus it contains basic server-client sample applications.
Checkout the Paul Griffiths' Echo server. It's a simple echo server and client written in C. It's written using some unix headers though, and will not work on Windows.
/* insert why didnt you google this comment */
here's one