mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-01-11 19:44:44 +00:00
# PDC-17 FixSettingHostname&Port
- I'm not sure this is the best way to fix this. I think the hostname and port variables need to be rethought in the TcpClient wrappers. This works for my needs for now but we still need to fix it globally.
This commit is contained in:
@@ -29,10 +29,27 @@ namespace PepperDash.Core
|
||||
//public event GenericSocketStatusChangeEventDelegate SocketStatusChange;
|
||||
public event EventHandler<GenericSocketStatusChageEventArgs> ConnectionChange;
|
||||
|
||||
|
||||
private string _Hostname { get; set;}
|
||||
/// <summary>
|
||||
/// Address of server
|
||||
/// </summary>
|
||||
public string Hostname { get; set; }
|
||||
public string Hostname {
|
||||
get
|
||||
{
|
||||
return _Hostname;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_Hostname = value;
|
||||
if (Client != null)
|
||||
{
|
||||
|
||||
Client.AddressClientConnectedTo = _Hostname;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Port on server
|
||||
@@ -233,10 +250,13 @@ namespace PepperDash.Core
|
||||
|
||||
if (Client == null)
|
||||
{
|
||||
|
||||
|
||||
Client = new TCPClient(Hostname, Port, BufferSize);
|
||||
Client.SocketStatusChange += Client_SocketStatusChange;
|
||||
}
|
||||
DisconnectCalledByUser = false;
|
||||
|
||||
Client.ConnectToServerAsync(ConnectToServerCallback); // (null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user