gogob

command
v0.0.0-...-35f559b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 6 Imported by: 0

README

gogob

This program demonstrates the simple use of gob package and the simplicity of Reader/Writer interfaces.

Server programs simply listens on a tcp socket and the clients send a struct encoded using gob. Server decodes them and sends an Ack encoded using gob as well.

Usage:

$ go run main.go -role server
Received message:  hello
Sent ack back.
$ go run main.go -role client
hello
Received ack from server:  Got your message. Thanks.

Documentation

Overview

This program demonstrates the simple use of gob package and the simplicity of Reader/Writer interfaces.

Server programs simply listens on a tcp socket and the clients send a struct encoded using gob. Server decodes them and sends an Ack encoded using gob as well.

This also transfers Msg as the interface type to showcase how this can be extended to multiple types.

Usage: $ go run main.go -role server Received message: hello Sent ack back.

$ go run main.go -role client hello Received ack from server: Got your message. Thanks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL