Playing with sockets
Posted: Fri Feb 07, 2014 7:38 pm
I'm trying to play around with Unix sockets. I'm trying to create a socket that will deliver a little text string payload, "Hello world.", each time a connection is made, and I'm going to write a little python program that will connect to the socket.
I've been working with ncat, but it's not working particularly well.
It's also not cleaning up the socket, but that fixed with a script.
Any ideas? I could switch to socat, but I'm not familiar with that program.
I've been working with ncat, but it's not working particularly well.
Code: Select all
Term1:
$ echo "Hello world." | ncat -lU ./test.sock -k
Term2:
$ ncat -U ./test.sock
"Hello World"
<ctrl+d>
$ ncat -U ./test.sock
<ctrl+d>
$
It's also not cleaning up the socket, but that fixed with a script.
Any ideas? I could switch to socat, but I'm not familiar with that program.