Skip to content

Commit

Permalink
修复了服务器ip设定没有生效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
daixian committed Oct 15, 2019
1 parent b017084 commit dd00b76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DNET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.12.1011")]
[assembly: AssemblyFileVersion("2.0.12.1011")]
[assembly: AssemblyVersion("2.0.13.1015")]
[assembly: AssemblyFileVersion("2.0.13.1015")]
3 changes: 3 additions & 0 deletions DNET/Server/SocketListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public bool IsStarted
/// <summary>
/// 启动服务器
/// </summary>
/// <param name="hostName">服务器的ip</param>
/// <param name="port">本机的服务器端口</param>
internal void Start(string hostName, int port)
{
Expand All @@ -128,6 +129,7 @@ internal void Start(string hostName, int port)
{
ipadr[i] = Convert.ToByte(hostName.Substring(ms[i].Index, ms[i].Length));
}
address = new IPAddress(ipadr);
}
else
{
Expand All @@ -137,6 +139,7 @@ internal void Start(string hostName, int port)

}
IPEndPoint localEndPoint = new IPEndPoint(address, port);
DxDebug.LogConsole("SocketListener.Start():尝试启动服务器 " + address + ":" + port);

//创建一个监听Socket
this._listenSocket = new Socket(localEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
Expand Down

0 comments on commit dd00b76

Please sign in to comment.