mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Stuff added
This commit is contained in:
parent
81e2043df9
commit
46ee2d6be6
|
@ -9,7 +9,7 @@ Proposal of a free as in freedom skype replacement:
|
|||
|
||||
## Basics:
|
||||
|
||||
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)
|
||||
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)
|
||||
|
||||
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?))
|
||||
|
||||
|
|
|
@ -56,6 +56,20 @@ int init_networking(IP ip ,uint16_t port)
|
|||
//initialize our socket
|
||||
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
|
||||
//Functions to increase the size of the send and recieve UDP buffers
|
||||
//NOTE: uncomment if necessary.
|
||||
/*
|
||||
int n = 1024 * 1024 * 2;
|
||||
if(setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&n, sizeof(n)) == -1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&n, sizeof(n)) == -1)
|
||||
{
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
//Set socket nonblocking
|
||||
#ifdef WIN32
|
||||
//I think this works for windows
|
||||
|
|
|
@ -23,6 +23,10 @@ Less important.
|
|||
No UDP hole punching on them so we need to do something else
|
||||
(only if both the clients which try to connect to themselves are behind one)
|
||||
|
||||
-Decentralized IRC like channels.
|
||||
|
||||
|
||||
|
||||
-Offline messaging protocol (text only)
|
||||
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).
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user