Commit 7276e1b8 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Small changes to sender.

parent ab36bdd3
......@@ -2,19 +2,20 @@
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <src/util/dbg.h>
#include "prrt/socket.h"
int main(int argc, char* const argv) {
int main(int argc, char *const argv) {
int i;
if(argc != 1) {
if (argc != 1) {
printf("Too few arguments.\n");
}
uint16_t local_port = 6000;
PrrtSocket sock = {};
printf("PRRT - SENDER\n");
debug("PRRT - SENDER\n");
if(PrrtSocket_create(&sock, local_port, TRUE) < 0) {
if (PrrtSocket_create(&sock, local_port, TRUE) < 0) {
perror("socket failed");
return 0;
}
......@@ -27,10 +28,10 @@ int main(int argc, char* const argv) {
uint16_t remote_port2 = 5004;
PrrtSocket_connect(&sock, remote_host2, remote_port2);
printf("SENDING\n");
debug("SENDING\n");
FILE * fp;
char * line = NULL;
FILE *fp;
char *line = NULL;
size_t len = 0;
fp = fopen("/opt/in.txt", "r");
......@@ -47,9 +48,9 @@ int main(int argc, char* const argv) {
if (line)
free(line);
usleep(1000 * 1000 * 6);
usleep(1000 * 1000);
PrrtSocket_close(&sock);
printf("COMPLETELY CLOSED\n");
debug("COMPLETELY CLOSED\n");
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment