diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | core/network.c | 14 | ||||
-rw-r--r-- | docs/TODO.txt | 4 |
3 files changed, 19 insertions, 1 deletions
@@ -9,7 +9,7 @@ Proposal of a free as in freedom skype replacement: | |||
9 | 9 | ||
10 | ## Basics: | 10 | ## Basics: |
11 | 11 | ||
12 | UDP most be used for everything simply because you can't do hole punching with TCP (well you can but it doesn't work all the time) | 12 | UDP must be used for everything simply because you can't do hole punching with TCP (well you can but it doesn't work all the time) |
13 | 13 | ||
14 | Every peer is represented as a byte string (the client id) (it is the hash (SHA-256?) of the public key of the peer). (if you want to add someone you need that id (either ask that person directly or maybe through some kind of search engine?)) | 14 | Every peer is represented as a byte string (the client id) (it is the hash (SHA-256?) of the public key of the peer). (if you want to add someone you need that id (either ask that person directly or maybe through some kind of search engine?)) |
15 | 15 | ||
diff --git a/core/network.c b/core/network.c index 10a37b80..9434f6fb 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -56,6 +56,20 @@ int init_networking(IP ip ,uint16_t port) | |||
56 | //initialize our socket | 56 | //initialize our socket |
57 | sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); | 57 | sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); |
58 | 58 | ||
59 | //Functions to increase the size of the send and recieve UDP buffers | ||
60 | //NOTE: uncomment if necessary. | ||
61 | /* | ||
62 | int n = 1024 * 1024 * 2; | ||
63 | if(setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&n, sizeof(n)) == -1) | ||
64 | { | ||
65 | return -1; | ||
66 | } | ||
67 | |||
68 | if(setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&n, sizeof(n)) == -1) | ||
69 | { | ||
70 | return -1; | ||
71 | }*/ | ||
72 | |||
59 | //Set socket nonblocking | 73 | //Set socket nonblocking |
60 | #ifdef WIN32 | 74 | #ifdef WIN32 |
61 | //I think this works for windows | 75 | //I think this works for windows |
diff --git a/docs/TODO.txt b/docs/TODO.txt index 9f999f09..c7d33952 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt | |||
@@ -23,6 +23,10 @@ Less important. | |||
23 | No UDP hole punching on them so we need to do something else | 23 | No UDP hole punching on them so we need to do something else |
24 | (only if both the clients which try to connect to themselves are behind one) | 24 | (only if both the clients which try to connect to themselves are behind one) |
25 | 25 | ||
26 | -Decentralized IRC like channels. | ||
27 | |||
28 | |||
29 | |||
26 | -Offline messaging protocol (text only) | 30 | -Offline messaging protocol (text only) |
27 | Use your friends.(or maybe the people closest (mathematically by comparing client_id's) to you or the friend you want to send the message to). | 31 | Use your friends.(or maybe the people closest (mathematically by comparing client_id's) to you or the friend you want to send the message to). |
28 | The message will not be very big. Let's say we limit the maximum number of bytes for one to 1024, it means if every client stores 1024 offline messages it only takes 1 MB of ram. | 32 | The message will not be very big. Let's say we limit the maximum number of bytes for one to 1024, it means if every client stores 1024 offline messages it only takes 1 MB of ram. |