Skip to content

Conversation

@gpayer
Copy link

@gpayer gpayer commented May 2, 2021

This pull request allows bidirectional communication. To enabled this a SendTo (analogue to PacketConn.WriteTo) was added to the Server struct. Now it is possible to both send messages to a server and receive its answers on the same port.

Further changes:

  • Store current connection in Server and use it. Therefor a SetConnection method was added as well and net.PacketConn parameters were removed.
  • Added Server.Listen(): enable the listening port, but do not start the Serve() loop yet. Useful if you send a message before listening for responses.
  • Packet.SenderAddress(): returns sender address (or nil) for the current message or bundle. This is necessary so a server can send responses to the correct address.

@gpayer gpayer mentioned this pull request May 2, 2021
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.

1 participant