-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCP support #34
Comments
I'll file a PR soon - it may be a week or two, as I'm working on testing my changes against a Java OSC library that also doesn't have TCP support yet. Let me know if you have any feedback on the changes I outlined above! |
I'm concerned about the future for this project as an upstream. I have a PR from almost 3 years back that have not been answered. Same situation for other PRs from earlier this year. It seems like @hypebeast is not around anymore to answer for this repo. It might be possible to use one of the forks as the new repo for future usage. |
I noticed that, too. I'd be happy to maintain my fork as the new "official" one. In the process of working on TCP support, I learned quite a lot about the library, and I feel like I could do an OK job of reviewing and merging PRs, including the ones that have gotten stale here. @hypebeast Any objections? |
I'd happily take on some of the maintenance, too, if this were to happen. |
If @hypebeast is not against it, we could breakout into a separate org |
I think creating a break-out org specifically for go-osc is a great idea. Let's give @hypebeast a few more days in case there is an objection, and then I'll go ahead and create the org. At that point, we can ideally transfer this repo there (would need to be done by @hypebeast), or we could create a new fork under that org. |
Hi, thanks for go-osc, it's great!
I'm working on adding TCP support to go-osc, both on the client and server side. In fact, I've just finished implementing it on my fork. It will be a while before I can make a PR, as I'm still testing the changes I've made. But I figured I would file an issue to give you a heads up and get some feedback about the changes, which I can summarize here.
API level
Clients and servers have a
SetNetworkProtocol(NetworkProtocol)
method.client.SetNetworkProtocol(TCP)
Added a
NewServer
constructor function that mirrorsNewClient
server.SetNetworkProtocol(TCP)
Incidental: added a
server.CloseConnection
function to facilitate testing and give users the ability to forcibly stop a running server.server.serve
setsserver.udpConnection
orserver.tcpListener
to the connection after creating it.server.CloseConnection
closes the appropriate connection if it's not nil.ListenAndServe
implementation includesdefer server.CloseConnection()
, ensuring that the connection it creates is closed in the event of an interruption or error.Implementation level
Added the following fields to the Client struct:
laddrTCP *net.TCPAddr
networkProtocol NetworkProtocol
Added the following fields to the Server struct:
udpConnection net.PacketConn
tcpListener net.Listener
client.SetLocalAddr
setsladdr
orladdrTCP
, depending on the protocolAdded a
server.ServeTCP(net.Listener)
that works likeserver.Serve(net.PacketConn)
.server.serve(func() (Packet, error))
function.Added a
server.ReceiveTCPPacket(net.Listener)
that works likeserver.ReceivePacket(net.PacketConn)
ioutil.ReadAll
to read all of the bytes (until EOF) into a byte array.Adjustments to tests
The text was updated successfully, but these errors were encountered: