NetworkTables v4 Handshake

I’m interested in implementing a .net 7 library for connecting to NetworkTables v4. Right up front, I’m having trouble understanding from the spec whether or not there needs to be a handshake on connection a la v3. I can establish a websocket connection and send what I think it’s expecting for a subscribe message, but when I try to read from it, I always get an exception saying the socket has been closed.

Hey there,

For my TS implementation, I didn’t need any special handshake. I would just make sure you are specifying the correct protocol for web sockets (networktables.first.wpi.edu) and also connecting to ws://<ip>/nt/<uid>. Here’s my TS socket stuff: ntcore-ts-client/packages/ntcore-ts-client/src/lib/socket at main · Chris2fourlaw/ntcore-ts-client · GitHub

2 Likes

Thanks, I think that was exactly my problem. I was missing the client name. I haven’t seen any data yet, but now it’s not disconnecting :hand_with_index_finger_and_thumb_crossed:

Awesome. I started working on a .NET one, but just kind of ran out of time. The client name thing was definitely confusing from my end as well. Glad someone else is willing to take the time to make a native .NET one work.

1 Like

Yep I found that and decided to bring it in spirit to the world of tables v4, net core and hopefully MAUI :slight_smile:
I’ll have it up on github as soon as I can get it past proof-of-concept.

I take that back, I hadn’t seen that project. The one I was looking at was v3 and you had DO NOT USE written all over it.

So naturally you decided to use it? :rofl:

(With updates to NT4 and stuff, but that’s not as funny)

The old NT3 stuff (I’m assuming GitHub - robotdotnet/NetworkTables: FRC NetworkTables for .NET. This is all old code and should not be used anymore.) was written back when I had no clue what I was doing (I still don’t, but I didn’t then either :smiley: )

I’m so glad NT4 makes it so much easier to write at least the client side. Server is still hard, but its much rarer server is needed in languages that don’t explicitly run on the robot.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.