Quote:
Originally Posted by BSDfan666
You're naming your local variable socket.. it clashes with the name of the socket function.
|
Yeah, a stupid mistake on my behalf..
They should really be called server_fd on a server app, right?
Quote:
Originally Posted by BSDfan666
[*]You populate a few elements of the sockaddr_in structure, but don't do anything with it.
|
I know that structs utterly pointless, as it isn't being used, but it shouldn't generate an error should it?
Hmmm, this still won't compile...
Code:
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types>
#define PORT 13
int main( void )
{
int sock = socket( AF_INET, SOCK_STREAM, 0 );
struct sockaddr_in address;
address.sin_family = AF_INET;
address.sin_port = PORT;
puts( "\nInitialization complete.\n" );
return 0;
}