-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Support connecting to UNIX/TCP sockets #175
Comments
I'm a bit undecided on the feature of letting tio be able to connect to sockets. I mean, if you want to connect to a UNIX socket you could easily do so with That being said, tio already supports redirecting serial I/O to a socket using e.g. On the other hand, there is the principle of letting one tool do one thing well, namely connecting to serial ports. |
Sadly |
After some more consideration I think it makes sense to support connecting to a socket as that will make tio be able to both serve a serial port via a socket and connect to it - it will be an end to end solution. In short we will be able to do the following: Host serial port on socket: Connect to same socket: However, getting there is a bit more involved. I'm making a TODO list here, mostly for my own reference. Besides a bit of refactoring the following changes spring to mind:
|
It would be really great to have unix socket support. |
Wonderful! Given your list of changes, can you update the issue title to also mention TCP? I came here to request that only to see you already considered it part of this request :) |
I'm not sure if this should be a separate issue, but if TCP support is planned, could RFC 2217 be a feature alongside TCP? TLDR on RFC2217: it's an extension to telnet that allows a client to specify COM port parameters to a server. Example being the client wanting to change the baud rate on a console server in real time. |
@Zorbatron That is possible but first things first. It can be added if there is a demand for it. |
RFC 2217 would definitely be the way to go for TCP connections, would allow connecting to ser2net, proprietary TCP serial gateways, etc.. |
Connecting to UNIX sockets comes in be handy with QEMU, for example. Like when you have a bunch of VMs and want to connect to a serial console:
Quick POC shows that everything works, I'm able to read/write to a serial console with a simple diff:
However it's necessary not call all TTY-related or else everything goes boom. I suspect that it's best to factor out two functions , one for each method. Anyway, if you are okay with the idea, I'll make a proper merge request.
The text was updated successfully, but these errors were encountered: