mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-26 05:24:21 +01:00
Remove some dead code
This commit is contained in:
parent
d7b06cdbef
commit
70ad18ab1d
@ -54,29 +54,12 @@ bool Network::InitSocket(const char *remote_host, int port)
|
|||||||
|
|
||||||
set_sock_opts(this->sock);
|
set_sock_opts(this->sock);
|
||||||
|
|
||||||
/* Connect to the server. */
|
/* Setup the socket address */
|
||||||
this->InitSockaddr(&this->connection_addr, remote_host, port);
|
this->InitSockaddr(&this->connection_addr, remote_host, port);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Network::ReceiveData(void *dst, int sock, size_t sz)
|
|
||||||
{
|
|
||||||
size_t received_sz = 0;
|
|
||||||
|
|
||||||
while (received_sz < sz)
|
|
||||||
{
|
|
||||||
int v = net_read(sock, dst, sz);
|
|
||||||
|
|
||||||
if (v < 0)
|
|
||||||
return false;
|
|
||||||
received_sz += v;
|
|
||||||
}
|
|
||||||
this->traffic += received_sz;
|
|
||||||
|
|
||||||
return sz > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssize_t Network::ReceiveFrom(void *dst, int sock, size_t sz,
|
ssize_t Network::ReceiveFrom(void *dst, int sock, size_t sz,
|
||||||
struct sockaddr_in *from)
|
struct sockaddr_in *from)
|
||||||
{
|
{
|
||||||
@ -91,22 +74,6 @@ ssize_t Network::SendTo(void *src, int sock, size_t sz, struct sockaddr_in *to)
|
|||||||
return net_sendto(sock, src, sz, 0, (struct sockaddr*)to, to_sz);
|
return net_sendto(sock, src, sz, 0, (struct sockaddr*)to, to_sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Network::SendData(void *src, int sock, size_t sz)
|
|
||||||
{
|
|
||||||
size_t sent_sz = 0;
|
|
||||||
|
|
||||||
while (sent_sz < sz)
|
|
||||||
{
|
|
||||||
int v = net_write(sock, (void*)src, sz);
|
|
||||||
|
|
||||||
if (v < 0)
|
|
||||||
return false;
|
|
||||||
sent_sz += v;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Network::Select(int sock, struct timeval *tv)
|
bool Network::Select(int sock, struct timeval *tv)
|
||||||
{
|
{
|
||||||
struct pollsd sds;
|
struct pollsd sds;
|
||||||
|
Loading…
Reference in New Issue
Block a user