-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a827c82
commit 135a40c
Showing
13 changed files
with
302 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net.Sockets; | ||
using System.Text; | ||
|
||
namespace NSmartProxy | ||
{ | ||
public class ClientAppWorker | ||
{ | ||
public List<TcpClient> TcpClientGroup = new List<TcpClient>(); | ||
public int AppId; //1~255 | ||
public int Port; //0~65535 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
//using System; | ||
//using System.Collections.Generic; | ||
//using System.Text; | ||
|
||
namespace NSmartProxy | ||
{ | ||
public class StringUtil | ||
{ | ||
public static byte[] IntToBytes(int number) | ||
{ | ||
return System.BitConverter.GetBytes(number); | ||
} | ||
//namespace NSmartProxy | ||
//{ | ||
// public class StringUtil | ||
// { | ||
// public static byte[] IntTo222Bytes(int number) | ||
// { | ||
// return System.BitConverter.GetBytes(number); | ||
// } | ||
|
||
/// <summary> | ||
/// 客户端首次连接服务端时,需要发送标记以便服务端归类 | ||
/// </summary> | ||
/// <param name="clientID"></param> | ||
/// <param name="appid"></param> | ||
/// <returns></returns> | ||
public static byte[] Generate1stRequestBytes(int clientID, int appid) | ||
{ | ||
byte[] bytes = IntToBytes(clientID); | ||
bytes[2] = (byte)appid; | ||
bytes[3] = 0; | ||
return bytes; | ||
} | ||
} | ||
} | ||
// /// <summary> | ||
// /// 客户端首次连接服务端时,需要发送标记以便服务端归类 | ||
// /// </summary> | ||
// /// <param name="clientID"></param> | ||
// /// <param name="appid"></param> | ||
// /// <returns></returns> | ||
// public static byte[] Generate1stRe为questBytes(int clientID, int appid) | ||
// { | ||
// byte[] bytes = IntToBytes(clientID); | ||
// bytes[2] = (byte)appid; | ||
// bytes[3] = 0; | ||
// return bytes; | ||
// } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.