Socat

Reconnect socat connection after network failure

让人想犯罪 __ 提交于 2019-12-06 05:44:36
问题 I am using a socat command to create a tty interface on my embedded linux device like: socat pty,link=/dev/ttyS9 TCP:10.0.10.1:9999 The connection is a long distance connecstion over a dsl-line. This line is disconnected every night and my tty interface is down. Is it possible to create the tty interace with a mechanism to reconnect until the server side is online again? Next question: is it possible to call the socat command from a java programm? Thanks a lot! Karl-Heinz 回答1: As of version V

Using socat for raw serial connection

别说谁变了你拦得住时间么 提交于 2019-12-05 01:47:42
问题 The goal is to connect to an embedded device using serial interface. So far, I've used: stty -F /dev/ttyS2 115200 cs8 ixoff socat readline,history=/etc/socat.history /dev/ttyS2,raw,echo=0 And it works excellent, but then I discovered that there are some options during system boot that require you to press a single key without pressing enter , and readline fails there. So my idea was to bind the ttyS2 to cons0 , but then I discovered multiple problems, such as inability to quit ( ctr+c , ctr+q

Https connection closed by peer in android 5.0 lollipop

≯℡__Kan透↙ 提交于 2019-12-04 22:00:12
I am trying to implement an android application.Therefore, I've called a web-service HTTPS .However, I am not able to get the response data.It showing an error " connection closed by peer " Here is my code for HTTPS : public class MySSLSocketFactory extends SSLSocketFactory { SSLContext sslContext = SSLContext.getInstance("TLS"); public MySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException { super(truststore); TrustManager tm = new X509TrustManager() { public void checkClientTrusted(X509Certificate[] chain,

Null modem emulator (com0com) for linux

◇◆丶佛笑我妖孽 提交于 2019-12-04 11:58:26
问题 I have a project that contains some unitary tests used to test the serial communications using COM ports (in windows). I use com0com to create a virtual pair of bounded ports and execute the tests. However I don't know how to do that in Linux neither in MACOS. I've read this topic: Are there some program like COM0COM in linux? Where the answer suggests using socat. I've tried that approach but it doesn't work, my application doesn't detect the ports I've just defined in socat. socat PTY,link=

Reconnect socat connection after network failure

守給你的承諾、 提交于 2019-12-04 09:51:24
I am using a socat command to create a tty interface on my embedded linux device like: socat pty,link=/dev/ttyS9 TCP:10.0.10.1:9999 The connection is a long distance connecstion over a dsl-line. This line is disconnected every night and my tty interface is down. Is it possible to create the tty interace with a mechanism to reconnect until the server side is online again? Next question: is it possible to call the socat command from a java programm? Thanks a lot! Karl-Heinz As of version V 1.4.0.0 socat features the options "retry", "forever", and "interval". So, this should give you the desired

How to make two-directional unix domain sockets with SOCK_DGRAM?

走远了吗. 提交于 2019-12-04 03:58:22
问题 I am trying to write a simple Unix datagram server/client, and am having some problems. What I want is a server that listens on a datagram socket and sends a reply to every message received, to the original sender. I decided to try first using socat to be the "server" and writing the client in C. I am running socat like this: socat UNIX-DGRAM:/tmp/test.socket,fork EXEC:echo To the best of my understanding this should listen on /tmp/test.socket and reply to everything that is received with the

Using socat for raw serial connection

≯℡__Kan透↙ 提交于 2019-12-03 16:47:08
The goal is to connect to an embedded device using serial interface. So far, I've used: stty -F /dev/ttyS2 115200 cs8 ixoff socat readline,history=/etc/socat.history /dev/ttyS2,raw,echo=0 And it works excellent, but then I discovered that there are some options during system boot that require you to press a single key without pressing enter , and readline fails there. So my idea was to bind the ttyS2 to cons0 , but then I discovered multiple problems, such as inability to quit ( ctr+c , ctr+q ctr+] and even esc doesn't work), backspace and delete do not work, letters are typed twice, etc. So

Null modem emulator (com0com) for linux

和自甴很熟 提交于 2019-12-03 07:53:57
I have a project that contains some unitary tests used to test the serial communications using COM ports (in windows). I use com0com to create a virtual pair of bounded ports and execute the tests. However I don't know how to do that in Linux neither in MACOS. I've read this topic: Are there some program like COM0COM in linux? Where the answer suggests using socat. I've tried that approach but it doesn't work, my application doesn't detect the ports I've just defined in socat. socat PTY,link=/dev/COM98 PTY,link=/dev/COM99 My theory is that socat cannot create virtual ports, it can only bind

center 安装 rabbitMQ

走远了吗. 提交于 2019-12-02 17:01:21
centerOs 安装 消息队列 rabbitMQ 下载 erlang https://www.erlang-solutions.com/resources/download.html 编辑文件 /etc/yum.repos.d/rabbitmq-erlang.repo centOS7 [rabbitmq-erlang] name=rabbitmq-erlang baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/21/el/7 gpgcheck=1 gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc repo_gpgcheck=0 enabled=1 安装 erlang 使用 yum 安装, 推荐安装方式(解决依赖) yum install rabbitmq-server-3.7.7-1.el7.noarch.rpm erlang-21.0.5-1.el7.centos.x86_64.rpm 将被安装 正在解决依赖关系 --> 正在检查事务 ---> 软件包 erlang.x86_64.0.21.0.5-1.el7.centos 将被 安装 --> 正在处理依赖关系 libcrypto.so.10(OPENSSL_1.0.2)

socat: tunnel IP through TTY

北战南征 提交于 2019-11-28 17:40:54
Is it possible to get an bidirectional IP-tunnel over ttyS0-like serial (modem) devices with the socat utility? I tried to use TUN option but still can't get the result. Any suggestions are welcome :) Update: PC1: socat /dev/ttyUSB0,raw,echo=0,b57600,clocal TUN:192.168.1.1/24,up PC2: socat /dev/ttyUSB0,raw,echo=0,b57600,clocal TUN:192.168.1.2/24,up After that, I have seen tun0 interfaces with proper addresses on both ends but I can't ping one from other. Instead of that, when I send data with ping -c 1 192.168.1.1 remote socat process exits and it's tun0 device destroyed. Any suggestions?..