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:
You can cast sockaddr_in to sockaddr, but you cannot usually cast ANY struct to ANY other and assume that things will work properly.