Tuesday, September 27, 2011

getsockname example c


See Also

2 comments:

  1. it helped a lot. thanks for maintaining the blog.

    ReplyDelete
  2. Note that it prints the information about the server, not the client: 127.0.0.24:9000 is the initial address:port where the client connected; for instance, if you have:
    client_sock = accept(socket_desc,(struct sockaddr *)&client,(socklen_t*)&c)
    (after a bind() and a listen()), you see that the information in client is very different from what you get with getsockname(client_sock,&client,&sa_len).

    ReplyDelete