Compare commits
No commits in common. "bf7f14acac6da603552daa2c03e9acbafe58ed5f" and "45111aae721f3b593e1e9ff6214e6339e50b39fa" have entirely different histories.
bf7f14acac
...
45111aae72
|
@ -11,10 +11,7 @@ client.Disconnected += (_, e) => Console.WriteLine($"Disconnected: {e.Disconnect
|
||||||
|
|
||||||
client.RegisterPacketHandler(PacketHandler<PongPacket>.Empty);
|
client.RegisterPacketHandler(PacketHandler<PongPacket>.Empty);
|
||||||
client.RegisterPacketHandler(new GoodbyePacketHandler());
|
client.RegisterPacketHandler(new GoodbyePacketHandler());
|
||||||
|
await client.ConnectAsync(IPAddress.IPv6Loopback, 1234);
|
||||||
var remoteEP = new IPEndPoint(IPAddress.Loopback, 1234);
|
|
||||||
Console.WriteLine($"Connecting to {remoteEP}");
|
|
||||||
await client.ConnectAsync(remoteEP);
|
|
||||||
|
|
||||||
Console.WriteLine($"Connected to {client.RemoteEndPoint}. My session is {client.SessionId}");
|
Console.WriteLine($"Connected to {client.RemoteEndPoint}. My session is {client.SessionId}");
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,7 @@ listener.ClientDisconnected += (_, e) => Console.WriteLine($"Client {e.Client.Se
|
||||||
|
|
||||||
listener.RegisterPacketHandler(new HelloPacketHandler());
|
listener.RegisterPacketHandler(new HelloPacketHandler());
|
||||||
listener.RegisterPacketHandler(new PingPacketHandler());
|
listener.RegisterPacketHandler(new PingPacketHandler());
|
||||||
|
|
||||||
Console.WriteLine("Starting listener");
|
|
||||||
listener.Start(1234);
|
listener.Start(1234);
|
||||||
Console.WriteLine($"Listener started on {listener.LocalEndPoint}");
|
|
||||||
|
|
||||||
await Task.Delay(-1);
|
await Task.Delay(-1);
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ public sealed class ProtocolClient : ClientNode
|
||||||
}
|
}
|
||||||
|
|
||||||
IsConnected = true;
|
IsConnected = true;
|
||||||
RemoteEndPoint = BaseSocket.RemoteEndPoint!;
|
RemoteEndPoint = BaseSocket.RemoteEndPoint;
|
||||||
|
|
||||||
State = ClientState.Handshaking;
|
State = ClientState.Handshaking;
|
||||||
var handshakeRequest = new HandshakeRequestPacket(ProtocolVersion);
|
var handshakeRequest = new HandshakeRequestPacket(ProtocolVersion);
|
||||||
|
|
|
@ -109,7 +109,7 @@ public sealed partial class ProtocolListener : Node
|
||||||
BaseSocket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, false);
|
BaseSocket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, false);
|
||||||
|
|
||||||
BaseSocket.Bind(localEP);
|
BaseSocket.Bind(localEP);
|
||||||
BaseSocket.Listen();
|
BaseSocket.Listen(10);
|
||||||
IsRunning = true;
|
IsRunning = true;
|
||||||
|
|
||||||
Started?.Invoke(this, EventArgs.Empty);
|
Started?.Invoke(this, EventArgs.Empty);
|
||||||
|
|
Loading…
Reference in New Issue