https://github.com/gytis-ivaskevicius/synchronoustcpserverlibrary
Simple Synchronous TCP Server Library written in C#.
https://github.com/gytis-ivaskevicius/synchronoustcpserverlibrary
easy-to-use library tcp-server tcp-socket
Last synced: 3 months ago
JSON representation
Simple Synchronous TCP Server Library written in C#.
- Host: GitHub
- URL: https://github.com/gytis-ivaskevicius/synchronoustcpserverlibrary
- Owner: gytis-ivaskevicius
- Created: 2017-01-05T18:07:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T14:43:45.000Z (about 8 years ago)
- Last Synced: 2025-03-24T08:54:43.637Z (3 months ago)
- Topics: easy-to-use, library, tcp-server, tcp-socket
- Language: C#
- Size: 78.1 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SynchronousTCPServerLibrary
Simple Synchronous TCP Server Library written in C#.
#Documentation## startListening(int port, int backlog)
1. port - Port on which server should run.
2. backlog - Maximum number of permitted connections.
Notes: Starts server in the same thread, in other words - everything that goes after this method wont be executed untill server is stoped. To avoid it - read below.
## startListeningInSeperateThread(int port, int backlog)
1. port - Port on which server should run.
2. backlog - Maximum number of permitted connections.
Notes: Creates thread in which it listens for connestions.
## closeServer()
Notes: Closes server.
## send(Socket socket, string message)
1. socket - Socket aka client.
2. message - message that you want to send.
## sendln(Socket socket, string message)
1. socket - Socket aka client.
2. message - message that you want to send.
Notes: Same as "send" but adds "new line" symbol at the end of the message.
## broadcast(string message)
1. message - message that you want to broadcast.
Notes: Broadcasts message to all clients.
## broadcastln(string message)
1. message - message that you want to broadcast.
Notes: Broadcasts message(with "new line" symbol) to all clients.
## kick(Socket socket)
1. socket - Disconnects socket(client) of ur choice.
## kickAll()
Note: Disconnects all sockets.
# Delegates
1.onConnect
2.onDisconnect
3.onDataReceive