Skip to content

Hometask 6 task 2 TCP client-server#7

Open
AlexSpaceBy wants to merge 1 commit into
masterfrom
hometask6.2
Open

Hometask 6 task 2 TCP client-server#7
AlexSpaceBy wants to merge 1 commit into
masterfrom
hometask6.2

Conversation

@AlexSpaceBy

Copy link
Copy Markdown
Owner

Client-Server communication by using buffer

}

// We dial to the server
conn, ok := net.Dial("tcp", "127.0.0.1:8083")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to open a connection and wait for incoming messages from STDIN, while this approach is OK too.

conn.Write([]byte(text))

// We read the message assuming that message is less than 100b
buffer := make([]byte, 100)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any bigger message? (optional)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants