Network/TcpClient: Fix disconnection of previous connection not happening with IP connection
Former-commit-id: 3ec17a6c56ee3f0aae7f66f78766f15d7a168f32
This commit is contained in:
parent
a0a088a914
commit
9d4256a4d2
|
|
@ -25,6 +25,7 @@ namespace Nz
|
||||||
NazaraAssert(remoteAddress.IsValid(), "Invalid remote address");
|
NazaraAssert(remoteAddress.IsValid(), "Invalid remote address");
|
||||||
NazaraAssert(remoteAddress.GetPort() != 0, "Remote address has no port");
|
NazaraAssert(remoteAddress.GetPort() != 0, "Remote address has no port");
|
||||||
|
|
||||||
|
Disconnect();
|
||||||
Open(remoteAddress.GetProtocol());
|
Open(remoteAddress.GetProtocol());
|
||||||
|
|
||||||
CallOnExit restoreBlocking;
|
CallOnExit restoreBlocking;
|
||||||
|
|
@ -46,8 +47,6 @@ namespace Nz
|
||||||
|
|
||||||
SocketState TcpClient::Connect(const String& hostName, NetProtocol protocol, const String& service, ResolveError* error)
|
SocketState TcpClient::Connect(const String& hostName, NetProtocol protocol, const String& service, ResolveError* error)
|
||||||
{
|
{
|
||||||
Disconnect();
|
|
||||||
|
|
||||||
UpdateState(SocketState_Resolving);
|
UpdateState(SocketState_Resolving);
|
||||||
std::vector<HostnameInfo> results = IpAddress::ResolveHostname(protocol, hostName, service, error);
|
std::vector<HostnameInfo> results = IpAddress::ResolveHostname(protocol, hostName, service, error);
|
||||||
if (results.empty())
|
if (results.empty())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue