From 842f3c4bf3ad105ef62476d74e6e9a0b82792910 Mon Sep 17 00:00:00 2001 From: Drutu Bogdan Date: Sat, 18 Dec 2010 18:25:44 +0200 Subject: [PATCH] update main to use this function --- src/main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 8f9839f..7276047 100644 --- a/src/main.c +++ b/src/main.c @@ -1,10 +1,25 @@ #include #include +#include +#include +#include +#include +#include + #include "lib_swift.h" int main() { - f(); + Swift s = socketSwift(); + struct sockaddr_in si_other; + socklen_t slen = sizeof(si_other); + + char buf[100]; + + recvfromSwift(s,buf,100,0,(struct sockaddr *)&si_other,&slen); + + printf("Received packet from %s:%d\nData: %s\n\n", + inet_ntoa(si_other.sin_addr), ntohs(si_other.sin_port), buf); return 0; } -- 2.20.1