mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-12 12:06:29 +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:
parent
e94f860b6e
commit
35af8d3172
1 changed files with 21 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue