update networking
This commit is contained in:
@@ -166,11 +166,21 @@ void client(std::string prefix)
|
||||
std::string buffer;
|
||||
buffer.resize(prefix.size() + extra_buff);
|
||||
|
||||
int sock = TcpSocket::connectt("petrovv.com", serverPort);
|
||||
int sock = TcpSocket::connectt("petrovv.com", keyPort);
|
||||
if (sock < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int64_t header = 0;
|
||||
TcpSocket::recvt(sock, &header, sizeof(header));
|
||||
|
||||
TcpSocket::closet(sock);
|
||||
|
||||
sock = TcpSocket::connectt("petrovv.com", serverPort);
|
||||
|
||||
if (sock < 0)
|
||||
{
|
||||
// printf("Error %d", sock);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -190,7 +200,7 @@ void client(std::string prefix)
|
||||
|
||||
// printf("id: %ld\n", ID);
|
||||
|
||||
TcpSocket::sendt(sock, &StartHeader, sizeof(StartHeader));
|
||||
TcpSocket::sendt(sock, &header, sizeof(header));
|
||||
TcpSocket::sendt(sock, &ID, sizeof(ID));
|
||||
|
||||
Message message;
|
||||
|
Reference in New Issue
Block a user