Jump to content

DELETE

trama09

DELETE

CPU Intel Core i7-4790K Motherboard ASUS Saberthooth Z97 Mark1 RAM Corsair Dominator Platinum 16GB @ 2133MHZ GPU 2 X MSI GeForce GTX GTX 980TI GAMING 6G SLI Case Phantex Enthoo Evolv ATX Storage Samsung 840 Pro Series 256GB / Western Digital Caviar Black 2TB PSU Corsair RM1000i Display Asus 4K PB287Q Cooling Noctua NF-A14 FLX & NF-F12 PWM /Thermaltake Water 3.0 Ultimate 360mm Keyboard Corsair K70 Mouse ROCCAT Kone XTD Sound Card Asus Xonar STX

Link to comment
Share on other sites

Link to post
Share on other sites

depending on the protocol that the socket will have to work on, the function will work with different data structures, having different addresses

 

the addrlen parameter refers to the size of the struct sockaddr *src_addr parameter, but the size of it could actually vary: you are allowed to cast the pointer to any of the other (pointers to) structure types in the family of struct sockaddr

for instance, if the socket is being used to communicate between processes in the same UNIX system, the structure that you will have to use is struct sockaddr_un

 

so, since the function has to read and write in/to that buffer, but that buffer can vary wildly, it needs to know the actual amount of data that can be read, and the amount of data that can be written to it

 

and yes, one of the protocol differences can be ipv4/ipv6, so you're right about that

Link to comment
Share on other sites

Link to post
Share on other sites

depending on the protocol that the socket will have to work on, the function will work with different data structures, having different addresses

 

the addrlen parameter refers to the size of the struct sockaddr *src_addr parameter, but the size of it could actually vary: you are allowed to cast the pointer to any of the other (pointers to) structure types in the family of struct sockaddr

for instance, if the socket is being used to communicate between processes in the same UNIX system, the structure that you will have to use is struct sockaddr_un

 

so, since the function has to read and write in/to that buffer, but that buffer can vary wildly, it needs to know the actual amount of data that can be read, and the amount of data that can be written to it

 

and yes, one of the protocol differences can be ipv4/ipv6, so you're right about that

Awesome thanks!

CPU Intel Core i7-4790K Motherboard ASUS Saberthooth Z97 Mark1 RAM Corsair Dominator Platinum 16GB @ 2133MHZ GPU 2 X MSI GeForce GTX GTX 980TI GAMING 6G SLI Case Phantex Enthoo Evolv ATX Storage Samsung 840 Pro Series 256GB / Western Digital Caviar Black 2TB PSU Corsair RM1000i Display Asus 4K PB287Q Cooling Noctua NF-A14 FLX & NF-F12 PWM /Thermaltake Water 3.0 Ultimate 360mm Keyboard Corsair K70 Mouse ROCCAT Kone XTD Sound Card Asus Xonar STX

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×