This is what I used for a main on the peers:
- Ive managed to connect to the server from the clients but not between
peer1:
#include "tcpunch.h"
#include
using std::cout;
using std::endl;
int main()
{
char buffer[1024];
int sock_fd = pair("my_pairing_name", "my-ip");
std::cout<<"here!";
int n = recv(sock_fd, buffer, 1024, 3126);
std::cout << "buffer: "<< buffer << endl;
}
// peer2:
#include "tcpunch.h"
#include
using std::cout;
using std::endl;
int main()
{
char buffer[1024];
sock_fd = pair("my_pairing_name", "myip");
char sendBuffer[] = "Hello world!";
int bytes = send(sock_fd, buffer, 14, 0);
}