No comment...
[swifty.git] / src / main.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <arpa/inet.h>
4 #include <netinet/in.h>
5 #include <sys/types.h>
6 #include <sys/socket.h>
7 #include <unistd.h>
8
9 #include "lib_swift.h"
10
11 int main()
12 {
13         Swift s = socketSwift();
14         struct sockaddr_in si_other;
15         socklen_t slen = sizeof(si_other);
16         
17         char buf[100];
18         
19         recvfromSwift(s,buf,100,0,(struct sockaddr *)&si_other,&slen);
20         
21         printf("Received packet from %s:%d\nData: %s\n\n", 
22                 inet_ntoa(si_other.sin_addr), ntohs(si_other.sin_port), buf);
23         
24         return 0;
25 }