I hardly believe that this compiles anywhere, for one..
- You're naming your local variable socket.. it clashes with the name of the socket function.
- You populate a few elements of the sockaddr_in structure, but don't do anything with it.
Code:
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#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;
}
It should at least compile now, but it's not exactly doing much of anything...
Helpful links:
http://beej.us/guide/bgnet/