I'm learning socket programming on Linux. I have some questions what I would like to ask. I hope you will help me!
That's why, that I'm new to Network Programming, I like to keep things simple.
When I use connect();, I need to connect like this:
Why can't I use connect like this?
connect(fd, (struct sockaddr *)&server, sizeof(struct sockaddr));
Why can't I just type IP address there, instead of (struct sockaddr *)&server. And what is that sizeof(struct sockaddr) thing? Why do I need it? Now for the server part. When making server, I need to declare this:
connect(fd, "184.108.40.206", sizeof(struct sockaddr));
And do this:
And in the end, after socket(); bind(); listen(); I need to accept(); Why does accept need this sin_size as an argument? Is it posible to make Networking app's, without using structures(sockaddr_in or others)?