|
|
@ -107,7 +107,7 @@ int create_remote (int network,char transport,char* address,int port) {
|
|
|
|
void forward_data(int from_fd, int to_fd) {
|
|
|
|
void forward_data(int from_fd, int to_fd) {
|
|
|
|
int n = 0;
|
|
|
|
int n = 0;
|
|
|
|
char* buffer = malloc(3000*sizeof(char));
|
|
|
|
char* buffer = malloc(3000*sizeof(char));
|
|
|
|
while ((n = recv(to_fd, buffer, 3000, 0)) > 0) { // read data from input socket
|
|
|
|
while ((n = recv(from_fd, buffer, 3000, 0)) > 0) { // read data from input socket
|
|
|
|
send(to_fd, buffer, n, 0); // send data to output socket
|
|
|
|
send(to_fd, buffer, n, 0); // send data to output socket
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|