-
Notifications
You must be signed in to change notification settings - Fork 31
/
README
80 lines (55 loc) · 1.9 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
NETSOCKET TCP CLIENT-SERVER SOCKET LIB
Library builds to NetSocket.dll
Works in .Net 2.0+ and mono 2.6+
Allows binary messages to be sent from client to server and vice-versa. Messages are prefixed with a simple header to track messages boundaries and keep everything synchronized. Messages are sent asynchronously in the order they are queued. The library automatically handles errors and disconnection as well as other erratum associated with the built-in Socket class.
Includes demo applications TestNetClient and TestNetServer
The TestNetServer application simply listens for connections on port 3333 and automatically accepts the first clients that connect. Valid messages are logged and echoed back to the client.
The TestNetClient application can connect to the server and send text messages or files.
Enums:
JLM.NetSocket.SocketState { Closed, Closing, Connected, Connecting, Listening }
Classes:
JLM.NetSocket.NetSocketConnectedEventArgs
Properties:
IPAddress SourceIP
JLM.NetSocket.NetSocketDisconnectedEventArgs
Properties:
string Reason;
JLM.NetSocket.NetSockStateChangedEventArgs
Properties:
SocketState NewState
SocketState PrevState
JLM.NetSocket.NetSockDataArrivalEventArgs
Properties:
byte[] Data
JLM.NetSocket.NetSockErrorReceivedEventArgs
Properties:
string Function
Exception Exception
JLM.NetSocket.NetSockConnectionRequestEventArgs
Properties:
Socket Client
JLM.NetSocket.NetBase (abstract)
Properties:
SocketState State
int LocalPort
string[] LocalIP
Events:
Connected
Disconnected
StateChanged
DataArrived
ErrorReceived
Methods:
void Send(byte[] data)
void Close(string reason)
JLM.NetSocket.NetClient > NetBase
Events:
ConnectionRequested
Methods:
void Listen(int port)
void Accept(Socket client)
JLM.NetSocket.NetServer > NetBase
Methods:
void Connect(IPEndPoint server)
License: LGPL <http://www.gnu.org/licenses/lgpl.html>
Copyright: 2011 Jeremy Messenger