0

I have an application which is writing on a port(TCP message using spring-integration tcp-outbound-channel on a particular port). I want to write a listener which will listen and validate the message coming on this port.

One of the recommendation is to use socket.io. I tried to do a sample POC, But I am unable to start non http server. How can I start a socket.io based server which will listen to messages sent over TCP( without http).

RAHUL ROY
  • 126
  • 2
  • 13
  • 1
    Can you share what you have already tried? – Shaq Apr 09 '19 at 12:06
  • 1
    Just an alternate way: I have came across same scenario, I have used plain java.net.ServerSocket (socket programming) to continuously listen and write back to port.Like creating ServerSocket instance for given port, read and write using input and output streams. – Suseendran P Apr 09 '19 at 12:13
  • @Shaq,I tried various thing , In java I couldn't find any example which doesn't include http. So I went node js way. I am not putting sample in question as it is not java. Here is a sample `var engine = require('engine.io'); var server = engine.listen(1603); server.on('connection', function(socket){ socket.send('utf 8 string'); socket.send(Buffer.from([0, 1, 2, 3, 4, 5])); // binary data }); ` – RAHUL ROY Apr 09 '19 at 12:21
  • [Suseendran](https://stackoverflow.com/users/952507/suseendran-p) I am also thinking about the same , but I thought of getting second opinion before committing on my decision. – RAHUL ROY Apr 09 '19 at 12:23

0 Answers0