Socket Programming
- Client and Server communicate by Socket
Test
-
start ServerCore and DummyClient at the same time
-
ServerCore\Program.cs
- DummyClient\Program.cs
Listener
- make listener to class
-
change blocking methods to non-blocking methods
- ServerCore\Listener.cs
Test
- ServerCore\Program.cs
- DummyClient\Program.cs
Session
- make receive and send to asynchronize
Receive async
- ServerCore\Session.cs
Test
- ServerCore\Program.cs
- DummyClient\Program.cs
Send async
- ServerCore\Session.cs
Test
Send packet
- match interface of receive and send
-
make send buffer to package
- ServerCore\Session.cs
Test
seperate Session
- seperate engine and contents
-
add EventHandler
- ServerCore\Session.cs
- Core Engine
- ServerCore\Listener.cs
- ServerCore\Program.cs
Test
Connector
-
avoid blocking method
- Connector
- Listener is for listening clients from server
- So, Connector is for connecting server from client
- ServerCore
- from now, this project is class library
- You should change start project to
DummyClient
andServer
and deleteProgram.cs
inServerCore
ServerCore
- ServerCore\Connector.cs
- ServerCore\Listener.cs
- ServerCore\Session.cs
Server
- Server\Program.cs
DummyClient
- DummyClient\Program.cs
Test
TCP vs UDP
- TCP
- There is a logical path assigned for connection
- The sequence of transmissions is guaranteed
- If loss occurs, responsible and retransmitted (reliability)
- Send only part of the item unless it is in a situation where it is exchanged (flow/confusion control)
- Speed is bad
- UDP
- There is not connection
- The sequence of transmissions is not guaranteed
- If loss occurs, non responsible(non reliability)
- Just sending
- Speed is good
Buffer
Recieve Buffer
- SeverCore\RecvBuffer.cs
- ServerCore\Session.cs
- Server\Program.cs
- DummyClient\Program.cs
Send Buffer
- ServerCore\SendBuffer.cs
- ServerCore\Session.cs
- Server\Program.cs
Test
Packet Session
-
you have to check sended data is whole data
-
ServerCore\Session.cs
- Server\Program.cs
- DummyClient\Program.cs