Skip to content

DamirPavlik/ascii-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASCII NET — Custom Protocol Built on TCP/IP

Welcome to the repository for my custom protocol, built on top of TCP/IP. This protocol provides a simple command-based system for real-time communication between clients and servers. It supports basic operations like registering users, joining channels, messaging, and listing users or channels.

Features

  • Client Registration: Allows users to register as clients on the server.
  • Channel Management: Clients can join or leave communication channels.
  • Messaging: Enables sending and receiving messages between users and channels.
  • User and Channel Listing: Clients can query the server for active users and channels.
  • Server Feedback: Acknowledgement and error handling for all commands.

Commands Overview

Command Issued By Description
REG Client Register as a client.
JOIN Client Join a specific channel.
LEAVE Client Leave the current channel.
CHNS Client List all available channels.
USRS Client List all users connected to the server.
OK Server Acknowledge the successful execution of a command.
ERR Server Indicate an error in the received command.
MSG Both Send or receive a message to/from a user or channel.

How It Works

  1. Client Registration (REG)
    The client starts by sending a REG command to the server to register itself.

    REG <handle>
    

    Example:

    REG @john
    
  2. Joining a Channel (JOIN)
    A registered client can join a communication channel using the JOIN command.

    JOIN <channel-id>
    

    Example:

    JOIN #general
    
  3. Leaving a Channel (LEAVE)
    Clients can leave the channel they are currently in using LEAVE.

    LEAVE <channel-id>
    

    Example:

    LEAVE #general
    
  4. Messaging (MSG)
    Messages can be sent to a specific user or channel. Messages from the server also arrive using this command.

    MSG <entity-id> <length>\r\n[payload]
    

    Example:

    MSG #general 16\r\nHello everyone!
    
  5. Listing Channels (CHNS)
    To get a list of all active channels, clients use the CHNS command.
    Example:

    CHNS
    
  6. Listing Users (USRS)
    To see a list of connected users, clients issue the USRS command.
    Example:

    USRS
    
  7. Acknowledgement and Errors (OK and ERR)
    The server responds with OK for successful operations or ERR for errors.
    Example:

    ERR Channel ID must begin with #
    ERR Username must begin with @
    

About

Custom Protocol Built on TCP/IP 🖧

Topics

Resources

Stars

Watchers

Forks

Languages