随时修改IP地址,否则DHCP之后得不到新的地址

This commit is contained in:
nnhy 2015-10-07 12:52:01 +00:00
parent 77b5d924e8
commit c36fe94922
2 changed files with 2 additions and 0 deletions

View File

@ -438,6 +438,7 @@ bool TcpSocket::Connect(IPAddress& ip, ushort port)
if(!Open()) return false;
}
Local.Address = Tip->IP;
Remote.Address = ip;
Remote.Port = port;

View File

@ -134,6 +134,7 @@ bool UdpSocket::Send(const ByteArray& bs)
{
//if(ip.IsAny()) ip = Remote.Address;
//if(!port) port = Remote.Port;
Local.Address = Tip->IP;
//byte buf[sizeof(ETH_HEADER) + sizeof(IP_HEADER) + sizeof(UDP_HEADER) + 1024];
byte buf[1500];