From: Bill Cunningham on

"Rick Jones" <rick.jones2(a)> wrote in message

> As far as writing a sockets program goes, you should be ignoring
> question of ARP or how a system is assigned an IP address.
> When it comes to the simplest client code:
> "You have the right to not code. Anything you code can and will be
> used against you by the compiler. You have the right to call bind().
> If you cannot afford a bind() call, one will be made for you by
> connect()." :)
> rick jones

OK how's this for starters? I've done this so far and I know it's not
much. I don't know if I need all the headers I've brought into scope though.

#include <stdio.h>
#include <sys/socket.h>
#include <inet/in.h>
#include <arpa/inet.h>

struct sockaddr_storage storage;
struct sockaddr address;
struct msghdr message;
struct cmsghdr cmess;

sa_family_t family=AF_INET;

Atleast a socket family has been declared.


From: Bill Cunningham on

"Bill Cunningham" <nospam(a)nspam.invalid> wrote in message

> sa_family_t family=AF_INET;

I know I could probably just pass AF_INET to the right function as a
parameter but atleast it's declared anyway.


First  |  Prev  | 
Pages: 1 2 3 4
Prev: Not able to change baud rate
Next: Basic Shell concept