As I mentioned in the community section I am using the mochad daemon on my device to control some x10 devices around my house and pick up motion sensor signals. Mochad opens up a socket that is used to interface with the cm15a or cm19a x10 usb interface device.
I can connect to this easily from another computer with the command `nc 192.168.x.x 1099` (with the real ip of the pogoplug obviously). However, on the plug itself `nc localhost 1099` or `nc 127.0.0.1 1099` or even `nc 192.168.x.x 1099` returns immediately. I have never seen this behavior on my other linux machines with mochad. I figure there is some aspect of networking on ArchLinux that I am missing.
$this->bbcode_second_pass_code('', '[root@alarm ~]# ss -arpt4
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 5 *:rmiregistry *:* users:(("mochad",826,8))
LISTEN 0 5 *:mctp *:* users:(("mochad",826,9))
LISTEN 0 5 *:pt2-discover *:* users:(("mochad",826,10))
LISTEN 0 128 *:ssh *:* users:(("sshd",1311,3))
ESTAB 0 0 192.168.2.111:rmiregistry 192.168.2.107:57816 users:(("mochad",826,11))
ESTAB 0 0 192.168.2.111:ssh 192.168.2.107:57823 users:(("sshd",1333,3))
')
I think the Mochad code creates a pretty straightforward socket (from mochad.c):
$this->bbcode_second_pass_code('', ' /**** sockets ****/
listenfd = socket(AF_INET, SOCK_STREAM, 0);
dbprintf("listenfd %d\n", listenfd);
memset(&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(SERVER_PORT);
rc = setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
dbprintf("setsockopt() %d/%d\n", rc, errno);
rc = bind(listenfd, (struct sockaddr*) &servaddr, sizeof(servaddr));
dbprintf("bind() %d/%d\n", rc, errno);
rc = listen(listenfd, 5);
dbprintf("listen() %d/%d\n", rc, errno);')