berkeley-sockets

Berkley sockets shutdown function, how important?

Hello, as background I've got an embedded device that talks to a third party server over IP. The code in the third party server is unlikely to change. In a recent release I changed the ip disconnect function to call shutdown() before calling close() (previously it had just called close()). The embedded device disconnects without complet...

How to test Berkley socket (BSD) API?

I'd like to test the correctness and the completeness of an implementation of the BSP API. The test set has to be cross-compiled for an ARM sam7x. ...

How to Avoid DOS Attack using Berkeley Sockets in C++

I'm working my way through UNIX Network Programming Volume 1 by Richard Stevens and attempting to write a TCP Echo Client that uses the Telnet protocol. I'm still in the early stages and attempting to write the read and write functions. I'd like to write it to use I/O Multiplexing and the Select function, because it needs to be multi...

How to ignore your own broadcast udp packets

For the following I'm assuming one network card. I have a component of my program which is designed to let others in the subnet know of its existence. For this, I've implemented a solution where whenever the program starts up (and periodically afterwards) it sends a broadcast to INADDR_BROADCAST - whoever listens on the required port w...

Dereferencing pointer does break strict anti-aliasing rules using Berkeley sockets

I've got code that looks something like this, where addr is a sockaddr*: struct sockaddr_in *sin = (struct sockaddr_in *) addr; const char *IP=inet_ntoa(sin -> sin_addr); I believe this is very typical code for using Berkeley sockets. However, when I compile this, I'm getting the following warning: dereferencing pointer 'sin' does br...