From: Drutu Bogdan Date: Sat, 18 Dec 2010 16:25:44 +0000 (+0200) Subject: update main to use this function X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=842f3c4bf3ad105ef62476d74e6e9a0b82792910;hp=ab00e545d3b341c79f60e903d79e1cfcb71197c6;p=swifty.git update main to use this function --- 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; }