View Single Post
  #3   (View Single Post)  
Old 3rd June 2009
SunSpyda SunSpyda is offline
Port Guard
Join Date: Mar 2009
Posts: 20

Originally Posted by BSDfan666 View Post
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?

Originally Posted by BSDfan666 View Post
[*]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...

#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;
Reply With Quote