advanced socket programming

hi every one
my post is about socket programming
i would know if anyone knows about send binary file in peer to peer connection.
if you have any information about it plzzz contact me or reply my post
thx
SpY974

You're asking for quite a bit here. As a starting point I would suggest reading a book. I like UNIX Network Programming by Rich Stevens.

In principle, all communication is 'binary'
That said, you have some options when creating a socket:

These are some protocols from a Linux book:
AF_UNIX (Is my book old, has this one gotten a new name?)
AF_INET - the one you probably want :slight_smile:
AF_ISO - Some new stuff ...
AF_NS - Xerox

Then, some socket types:

SOCK_STREAM - probably most used, connection based
SOCK_DGRAM - very intersting, can be fast on LAN
SOCK_RAW - Maybe this is the one you want?
If you build a new protocol, you may use this?

In principle, sockets are used like files:

open, read/write, close.

So, to transfer a file, you would open and write in one end, and open, read and close in the other ... but you probably have something particular in mind ...??

This is a GROSS oversimplification, does not speak about bind(), listen(), accept(), etc. - but check socket(3SOCKET), it will contain links to the other relevant calls.

Atle