Skip to content

Tag: sockets

Connection refused – tcp socket in linux [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 years ago. Improve this question Ok, f…

Raw Sockets in C

1. The linux manual page says about this code. In socket option, if IP_HDRINCL is set, I can make IP header. Am I right? If it’s right, above socket also let me make TCP header, too? Then, if IP_HDRINCL is not set, what means above socket? 2. what means above code comparing to number 1 question’s …

Detect client is disconnected

I have a simple program that listens to a socket. Everything goes fine except when the connection is lost in while(1) cycle. In this case the program falls into read from socket for many times without result. How can I detect a disconnected client in while(1) cycle? Answer Change: To: Also, your code mishandl…

errno.h socket/connection error classification

I’m using boost::asio on linux to send http request, using almost exactly this code boost asio http I want to catch exceptions and classify them using errno.h error codes to three groups GROUP 1. errors occurred because of local host socket/connection. GROUP 2. errors occurred because of local host or r…

Merged Socket->recv with perl on Linux

Sorry for the bad English, it is not my mother tongue. I am new to perl programming and I’m facing a tedious problem for some hours now. I have coded a simple Client-Server using IO::Socket::INET. It works flawlessly on Windows, but is broken on Linux. On Linux, the first recv get both of server’s…