Untitled
unknown
plain_text
3 months ago
784 B
5
Indexable
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<unistd.h> #include<sys/types.h> #include<sys/select.h> #include<arpa/inet.h> #include<stdlib.h> #include<pthread.h> #define timeoutValue 5 #define packetCount 5 #define windowSize 3 void sendWindowPackets(int*sockfd,struct sockaddr_in addr,int packages[]'int windowStart,int windowEnd) { char buffer[1024]; while(windowStart<windowEnd) { bzero(buffer,1024); sprintf(buffer,"%d",packets[windowStart]); printf("client:sending packet%s\n",buffer); send to(*sockfd,buffer,1024,0[struct sockaddr*]&addr,size of (addr)); windowStart ++; } } void main() char*ip=127.0.0.100; int port=5555; pthread_t timeoutThread; int sockfd; struct sockaddr_in addr; char buffer[1024]; socklen_t addr_size; sockfd=socket(AF_INET,SOCK_DGRAM,)
Editor is loading...
Leave a Comment