Any one could describe how (struct sockaddr *)&server works here? Is it possible to cast bigger struct to smaller struct?
(struct sockaddr *)&server
See these structs:
In C, it's possible to cast anything to anything. You could even omit the cast to (struct sockaddr*), and probably just get a compiler warning.