Open marceline-cramer opened 3 years ago
Closed as of 7/13/21 meetup and review of the codebase?
Closed as of 7/13/21 meetup and review of the codebase?
No, usernames still can't be sent over and logged yet... we can make more plans at the next meeting, but the code itself isn't ready.
Here's a bare minimum network story:
mdo-cli
with a--server
command-line argument (server)mdo-cli
without that argument (client)ExampleUsername
for now)There's no immediate need to use an advanced protocol definition format like FlatBuffers, so for this basic demo, sending simple strings in packets is fine. Remember to appropriately handle null termination.
Other than the
--serverless
flag passed to the CLI to select whether the server or the client is running, there's no need to provide any other configuration to the CLI to get a basic networking demo working. That can be figured out in a future issue. For now, hardcoding alocalhost
address and port, and using a hard username likeExampleUsername
is fine.Physical implementation:
network_client
andnetwork_server
objects:include/network/network_server.h
include/network/network_client.h
src/network/network_server.c
src/network/network_client.c
network_server
to listen on alocalhost
port, handle incoming clients and safely handle remote hang-upsnetwork_server
(like "ExampleUsername connected") and broadcast them back out to clientsnetwork_client
to connect to alocalhost
port, and log received stringscli/main.c
, scan the arguments for--serverless
usingstrcmp()
, and initialize eithernetwork_server
ornetwork_client
depending on presence of the flag