Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nxrighthere authored Aug 27, 2018
1 parent d7615a3 commit dbcb94e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ while (!Console.KeyAvailable) {
break;

case EventType.Connect:
Console.WriteLine("Client connected - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.Address.GetIP());
Console.WriteLine("Client connected - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.IP);
break;

case EventType.Disconnect:
Console.WriteLine("Client disconnected - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.Address.GetIP());
Console.WriteLine("Client disconnected - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.IP);
break;

case EventType.Timeout:
Console.WriteLine("Client timeout - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.Address.GetIP());
Console.WriteLine("Client timeout - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.IP);
break;

case EventType.Receive:
Console.WriteLine("Packet received from - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.Address.GetIP() + ", Channel ID: " + netEvent.ChannelID + ", Data length: " + netEvent.Packet.Length);
Console.WriteLine("Packet received from - ID: " + netEvent.Peer.ID + ", IP: " + netEvent.Peer.IP + ", Channel ID: " + netEvent.ChannelID + ", Data length: " + netEvent.Packet.Length);
netEvent.Packet.Dispose();
break;
}
Expand Down Expand Up @@ -174,10 +174,6 @@ Contains a marshalled structure from the unmanaged side with host data and port

`Address.SetHost(string hostName)` set host name or an IP address (IPv4/IPv6). Returns 0 on success or < 0 on failure.

`Address.GetIP()` returns an IP address in a printable form.

`Address.GetName()` returns a name after attempts to do a reverse lookup of the host.

#### Event
Contains a marshalled structure from the unmanaged side with the event type, managed pointer to the peer, channel ID, user-supplied data, and managed pointer to the packet.

Expand Down Expand Up @@ -211,6 +207,8 @@ Contains a managed pointer to the peer.

`Peer.ID` returns a peer ID.

`Peer.IP` returns an IP address of a peer in a printable form.

`Peer.Address` returns an address associated with the peer.

`Peer.State` returns a peer state described in the `PeerState` enumeration.
Expand Down

0 comments on commit dbcb94e

Please sign in to comment.