ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am working on Linux redhat 9,two machines running tcpserver and tcpclient programmes,I need to send about "50000" Byte of integers, the server sends them well,but the client recieves about "12287" Byte well,but it recieves the rest of numbers zeroes!!!!!!!!!!!!!!!!!,Inever understood that.
any help will be appresiated.
abdobl.
main(int argc,char *argv[])
{
int create_socket;
int bufsize = 50000;
int *buffer = malloc(bufsize);
struct sockaddr_in address;
printf("\x1B[2J");
if ((create_socket = socket(AF_INET,SOCK_STREAM,0)) > 0)
printf("The Socket was created\n");
address.sin_family = AF_INET;
address.sin_port = htons(15000);
inet_pton(AF_INET,argv[1],&address.sin_addr);
if (connect(create_socket,(struct sockaddr *)&address,sizeof(address)) == 0)
printf("The connection was accepted with the server %s...\n",inet_ntoa(address.sin_addr));
int x=0,d,a[RAW][COL],b[RAW][COL],c[RAW][COL],i=0,j,t=0,k,q,w;
main(int argc,char *argv[])
{
int create_socket;
int bufsize = 50000;
int *buffer = malloc(bufsize);
struct sockaddr_in address;
printf("\x1B[2J");
if ((create_socket = socket(AF_INET,SOCK_STREAM,0)) > 0)
printf("The Socket was created\n");
address.sin_family = AF_INET;
address.sin_port = htons(15000);
inet_pton(AF_INET,argv[1],&address.sin_addr);
if (connect(create_socket,(struct sockaddr *)&address,sizeof(address)) == 0)
printf("The connection was accepted with the server %s...\n",inet_ntoa(address.sin_addr));
int x=0,d,a[RAW][COL],b[RAW][COL],c[RAW][COL],i=0,j,t=0,k,q,w;
Hi ..................
It did not work.I did try ,but it did not work,
there some thing I wondering about.
at the first,two aor three times it works well,and two or three times it does not work,after that may be work ,may be not.I do not know what is going on.
Hi......
I try to use it but when I compile the code the compile is fails,I do not know why,may be because I do not know how to use sniffers ,you want the true ,it's the first time I listen of them. can you exolain please how to use it,and where can I put the functions you gave me.
abdobl
sorry,but there is some thing I want to explaine,when I run the programms on boat machines only 361 Bytes of my transmitted data were recieved,the rest of data were zeroes{from 362 to any number}.I do not know why,
abdobl..my regards.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.