projects
/
swifty.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ab00e54
)
update main to use this function
author
Drutu Bogdan
<bcristia@adobe.com>
Sat, 18 Dec 2010 16:25:44 +0000
(18:25 +0200)
committer
Razvan Deaconescu
<razvan.deaconescu@cs.pub.ro>
Sat, 2 Apr 2011 07:27:23 +0000
(10:27 +0300)
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index
8f9839f
..
7276047
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-1,10
+1,25
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
#include "lib_swift.h"
int main()
{
#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;
}
return 0;
}