C(pure) Network programming questions
Dear all,
I am reading and programming these days sockets, which I find great. I have some questions though :) If anyone wants to share the fun please join a) I found that the maximum udp packet I can send is of 1607 bytes. A packet of 1608 will make sendto() to return -1. How I can find what are the maximum packet size for UDP and TCP? When the programmer has to care about the fragmentation? b) I am using eclipse to write c :) When I start new c projects eclipse "asks" Do you want to use Cross gcc or Linux gcc. Where I can find more info regarding those differences? c) Code:
#include <sys/types.h> /* See NOTES */ d) In function prototypes like the c, the *datatype..."means": give me an address. Either by &mydatatype or *pointer=&mydatatype and then pass pointer. Right? e) When I use funtions like socket, bind e.t.c I use perror to control when something went wrong. Example Code:
if ((sockfd=socket(domain,type, protocol))==-1) f) When setting the port (of a socket) I use Code:
struct sockaddr_in addr; Code:
in_port_t sin_port; /* port in network byte order */ g) A typical thing in c is the number of warning one gets. I am not quite sure which ones you can ignore and which not. For example I found many times the "implicit declaration" ... how do you handle the warnings? I would like to thank you in advance for the time spent Regards Alex |
e) http://pubs.opengroup.org/onlinepubs...ns/perror.html
see example also |
All times are GMT -5. The time now is 01:39 PM. |