This repository was archived by the owner on Sep 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Казанджи Михаил - 3520901/70201 #7
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Я словил кучу проблем с динамической типизацией в Ruby и как следствием не возможность оперировать байтами, без черной магии и переписал все на C#. Собирается и на .Net, и на .NetCore. Протестировано на Windows 10 и на Ubuntu 20.10 В сообщениях используется UTF-16, поэтому значение поля size надо делить на 2 Протокол был переработан. Были введены следующие типы пакетов:
|
Из положительных моментов:
Из отрицательных:
Софт запускался на user@ubuntu-s-1vcpu-1gb-fra1-01:~/2020H2/lab1$ Lab1/bin/Debug/netcoreapp3.1/Lab1 1843
Server started...
New client: lol
Client not send head packet
New client: q
Client not send head packet
^CShutting down Лог клиента 1: ➜ Lab1_client/bin/Debug/netcoreapp3.1/Lab1_client 138.68.87.131 1843 lol
[1/2/2021 11:23 AM] <Server> Hello! Glad to see you lol on our server
Hey yo!
Q!
kd;sjg
Shutting down Лог клиента 2: user@ubuntu-s-1vcpu-1gb-fra1-01:~/2020H2/lab1$ Lab1_client/bin/Debug/netcoreapp3.1/Lab1_client 127.0.0.1 1843 q
[01/02/2021 11:24] <Server> Hello! Glad to see you q on our server
hey yi!
jwe
kdhg;slh
gShutting down
|
Ktlo
pushed a commit
to Ktlo/2020H2
that referenced
this pull request
Jan 5, 2021
Ktlo
added a commit
to Ktlo/2020H2
that referenced
this pull request
Jan 5, 2021
Implement message encoding/decoding (insysnw-archive#7) See merge request spbstu/net-lab3!7
Прикрутил парсинг ip - можно задавать localhost или сам адрес. |
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Лабораторная 1
Работа выполнена на ruby с использованием стандартных гемов, поэтому для запуска требуется только ruby 2.5+. Тестирование проводилось на Ubuntu 20.10. Теоретически должно работать по Windows, но не было возможности это проверить
Содержимое работы
Запуск
ruby server
port - номер порта, который будет прослушивать сервер
ruby client
ip - адрес сервера
port - рабочий порт сервера
nik - ник пользователя на сервере
Протокол взаимодействия
Сообщения представляют собой строки формата:
[timestamp] <nik> text~@~
timestamp - метка времени в формате unix
nik - ник пользователя на сервере
text - само сообщение
~@~ - признак конца сообщения
В ника запрщено использовать символ ']'. Единственное ники на сервере никак не обрабатываются, поэтому все клиенты могут радостно сидеть под одним ником