Hi. I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need. What you think? (I don't want to implement another one incoming connections loop)
Hi Denis, There is http://www.squeaksource.com/SocketExamples.html http://www.squeaksource.com/Net.html Last one seems a lot of interesting work. or look for #remoteTestServerTCP which was in OldSocket or Socket some time ago: remoteTestServerTCP "See remoteTestClientTCP for instructions on running this method." "OldSocket remoteTestServerTCP" | socket client buffer n | Transcript show: 'initializing network ... '. Socket initializeNetwork. Transcript show:'ok';cr. socket _ OldSocket newTCP. socket listenOn: 54321 backlogSize: 5 interface: (NetNameResolver addressFromString: '127.0.0.1'). "or: 0.0.0.0" Transcript show: 'server endpoint created -- run client test in other image'; cr. buffer _ String new: 4000. socket waitForConnectionUntil: self standardDeadline. client _ socket accept. [client isConnected] whileTrue: [ client dataAvailable ifTrue: [n _ client receiveDataInto: buffer. client sendData: buffer count: n]]. client closeAndDestroy. socket closeAndDestroy. Transcript cr; show: 'server endpoint destroyed'; cr. ^socket Cheers, Hernán 2015-12-10 8:07 GMT-03:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need.
What you think?
(I don't want to implement another one incoming connections loop)
I wish i could say this can work in JacobsLadder, but it didn't work for me a few days back. Perhaps somebody else can get it to be make to work. I am sure it is possible and probable. There is much potential, thank God. best, robert On 12/17/2015 12:53 PM, Hernán Morales Durand wrote:
Hi Denis,
There is
http://www.squeaksource.com/SocketExamples.html http://www.squeaksource.com/Net.html
Last one seems a lot of interesting work.
or look for #remoteTestServerTCP which was in OldSocket or Socket some time ago:
remoteTestServerTCP "See remoteTestClientTCP for instructions on running this method." "OldSocket remoteTestServerTCP"
| socket client buffer n | Transcript show: 'initializing network ... '. Socket initializeNetwork. Transcript show:'ok';cr. socket _ OldSocket newTCP. socket listenOn: 54321 backlogSize: 5 interface: (NetNameResolver addressFromString: '127.0.0.1'). "or: 0.0.0.0" Transcript show: 'server endpoint created -- run client test in other image'; cr. buffer _ String new: 4000. socket waitForConnectionUntil: self standardDeadline. client _ socket accept. [client isConnected] whileTrue: [ client dataAvailable ifTrue: [n _ client receiveDataInto: buffer. client sendData: buffer count: n]]. client closeAndDestroy. socket closeAndDestroy. Transcript cr; show: 'server endpoint destroyed'; cr. ^socket
Cheers,
Hernán
2015-12-10 8:07 GMT-03:00 Denis Kudriashov <dionisiydk@gmail.com <mailto:dionisiydk@gmail.com>>:
Hi.
I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need.
What you think?
(I don't want to implement another one incoming connections loop)
-- . .. .. ^,^ best, robert
Hello. So my question not about how to do it. But how to not copy another time classic incoming connections loop. I not found ready solution. So I created simplest TCPServer project <http://smalltalkhub.com/#!/~Pharo/TCPServer>with good tests. Now you can subclass TCPServer and implement single method #processNewConnection:. That's all. (Not release version yet. There is only development version) Best regards, Denis 2015-12-17 18:53 GMT+01:00 Hernán Morales Durand <hernan.morales@gmail.com>:
Hi Denis,
There is
http://www.squeaksource.com/SocketExamples.html http://www.squeaksource.com/Net.html
Last one seems a lot of interesting work.
or look for #remoteTestServerTCP which was in OldSocket or Socket some time ago:
remoteTestServerTCP "See remoteTestClientTCP for instructions on running this method." "OldSocket remoteTestServerTCP"
| socket client buffer n | Transcript show: 'initializing network ... '. Socket initializeNetwork. Transcript show:'ok';cr. socket _ OldSocket newTCP. socket listenOn: 54321 backlogSize: 5 interface: (NetNameResolver addressFromString: '127.0.0.1'). "or: 0.0.0.0" Transcript show: 'server endpoint created -- run client test in other image'; cr. buffer _ String new: 4000. socket waitForConnectionUntil: self standardDeadline. client _ socket accept. [client isConnected] whileTrue: [ client dataAvailable ifTrue: [n _ client receiveDataInto: buffer. client sendData: buffer count: n]]. client closeAndDestroy. socket closeAndDestroy. Transcript cr; show: 'server endpoint destroyed'; cr. ^socket
Cheers,
Hernán
2015-12-10 8:07 GMT-03:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need.
What you think?
(I don't want to implement another one incoming connections loop)
On Fri, Dec 18, 2015 at 8:28 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hello.
So my question not about how to do it. But how to not copy another time classic incoming connections loop. I not found ready solution. So I created simplest TCPServer project with good tests. Now you can subclass TCPServer and implement single method #processNewConnection:. That's all.
cool idea.
(Not release version yet. There is only development version)
Best regards, Denis
2015-12-17 18:53 GMT+01:00 Hernán Morales Durand <hernan.morales@gmail.com>:
Hi Denis,
There is
http://www.squeaksource.com/SocketExamples.html http://www.squeaksource.com/Net.html
Last one seems a lot of interesting work.
or look for #remoteTestServerTCP which was in OldSocket or Socket some time ago:
remoteTestServerTCP "See remoteTestClientTCP for instructions on running this method." "OldSocket remoteTestServerTCP"
| socket client buffer n | Transcript show: 'initializing network ... '. Socket initializeNetwork. Transcript show:'ok';cr. socket _ OldSocket newTCP. socket listenOn: 54321 backlogSize: 5 interface: (NetNameResolver addressFromString: '127.0.0.1'). "or: 0.0.0.0" Transcript show: 'server endpoint created -- run client test in other image'; cr. buffer _ String new: 4000. socket waitForConnectionUntil: self standardDeadline. client _ socket accept. [client isConnected] whileTrue: [ client dataAvailable ifTrue: [n _ client receiveDataInto: buffer. client sendData: buffer count: n]]. client closeAndDestroy. socket closeAndDestroy. Transcript cr; show: 'server endpoint destroyed'; cr. ^socket
Cheers,
Hernán
2015-12-10 8:07 GMT-03:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need.
What you think?
(I don't want to implement another one incoming connections loop)
Hi Denis, This makes me think about the VNC server, which is a TCP server. The implementation of it is on top of another generic one. http://www.smalltalkhub.com/#!/~PharoExtras/RFB Best, Phil On Fri, Dec 18, 2015 at 1:28 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hello.
So my question not about how to do it. But how to not copy another time classic incoming connections loop. I not found ready solution. So I created simplest TCPServer project <http://smalltalkhub.com/#!/~Pharo/TCPServer>with good tests. Now you can subclass TCPServer and implement single method #processNewConnection:. That's all.
(Not release version yet. There is only development version)
Best regards, Denis
2015-12-17 18:53 GMT+01:00 Hernán Morales Durand <hernan.morales@gmail.com
:
Hi Denis,
There is
http://www.squeaksource.com/SocketExamples.html http://www.squeaksource.com/Net.html
Last one seems a lot of interesting work.
or look for #remoteTestServerTCP which was in OldSocket or Socket some time ago:
remoteTestServerTCP "See remoteTestClientTCP for instructions on running this method." "OldSocket remoteTestServerTCP"
| socket client buffer n | Transcript show: 'initializing network ... '. Socket initializeNetwork. Transcript show:'ok';cr. socket _ OldSocket newTCP. socket listenOn: 54321 backlogSize: 5 interface: (NetNameResolver addressFromString: '127.0.0.1'). "or: 0.0.0.0" Transcript show: 'server endpoint created -- run client test in other image'; cr. buffer _ String new: 4000. socket waitForConnectionUntil: self standardDeadline. client _ socket accept. [client isConnected] whileTrue: [ client dataAvailable ifTrue: [n _ client receiveDataInto: buffer. client sendData: buffer count: n]]. client closeAndDestroy. socket closeAndDestroy. Transcript cr; show: 'server endpoint destroyed'; cr. ^socket
Cheers,
Hernán
2015-12-10 8:07 GMT-03:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need.
What you think?
(I don't want to implement another one incoming connections loop)
2015-12-18 16:43 GMT+01:00 phil@highoctane.be <phil@highoctane.be>:
Hi Denis,
This makes me think about the VNC server, which is a TCP server.
The implementation of it is on top of another generic one.
I will look at it to extract error handling logic. I not look at it too much for now. But when I do I will put nice tests for this cases. Which is very important to me. Not only loop implementation duplicated in every servers but tests too (and most times no tests exists)
On 18 Dec 2015, at 18:17, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2015-12-18 16:43 GMT+01:00 phil@highoctane.be <phil@highoctane.be>: Hi Denis,
This makes me think about the VNC server, which is a TCP server.
The implementation of it is on top of another generic one.
http://www.smalltalkhub.com/#!/~PharoExtras/RFB
I will look at it to extract error handling logic. I not look at it too much for now. But when I do I will put nice tests for this cases. Which is very important to me. Not only loop implementation duplicated in every servers but tests too (and most times no tests exists)
ZnServer and subclasses have a quite robust implementation of server socket to connection handler logic with extensive error handling. All there in the standard image. But I assume you already looked at it.
2015-12-18 18:21 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>:
ZnServer and subclasses have a quite robust implementation of server socket to connection handler logic with extensive error handling. All there in the standard image. But I assume you already looked at it
Yes. I will reuse zinc logic too. And maybe in future we can subclass ZnServer from TCPServer.
Hi Sven, I personally had not looked at Zinc. That's looking good. Therefore, I have a question about how to modify for my own client. You see, I implement a secure protocol that is different than HTTPS/SSL. I think you support SSL. How could I replace your rendezvous handshake with mine? I am looking for the secure state-machine entry point. ANother concern was which size frag packet and which size RS encdding, now that that is getting integrated. Many thanks, and for SmalltalkHub registation, as well. Robert On 12/18/2015 12:21 PM, Sven Van Caekenberghe wrote:
On 18 Dec 2015, at 18:17, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2015-12-18 16:43 GMT+01:00 phil@highoctane.be <phil@highoctane.be>: Hi Denis,
This makes me think about the VNC server, which is a TCP server.
The implementation of it is on top of another generic one.
http://www.smalltalkhub.com/#!/~PharoExtras/RFB
I will look at it to extract error handling logic. I not look at it too much for now. But when I do I will put nice tests for this cases. Which is very important to me. Not only loop implementation duplicated in every servers but tests too (and most times no tests exists) ZnServer and subclasses have a quite robust implementation of server socket to connection handler logic with extensive error handling. All there in the standard image. But I assume you already looked at it.
-- . .. .. ^,^ robert
On 18 Dec 2015, at 18:33, Robert Withers <robert.w.withers@gmail.com> wrote:
Hi Sven, I personally had not looked at Zinc. That's looking good. Therefore, I have a question about how to modify for my own client. You see, I implement a secure protocol that is different than HTTPS/SSL. I think you support SSL. How could I replace your rendezvous handshake with mine? I am looking for the secure state-machine entry point.
Have a look at ZdcSecureSocketStream from the Zodiac package, which is a standard part of Pharo too (http://zdc.stfx.eu in particular http://zdc.stfx.eu/zodiac-paper.html). I think you are looking for #connect and #accept which are the setup hooks for the client and server respectively doing the setup.
ANother concern was which size frag packet and which size RS encdding, now that that is getting integrated.
Many thanks, and for SmalltalkHub registation, as well. Robert
On 12/18/2015 12:21 PM, Sven Van Caekenberghe wrote:
On 18 Dec 2015, at 18:17, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2015-12-18 16:43 GMT+01:00 phil@highoctane.be <phil@highoctane.be>: Hi Denis,
This makes me think about the VNC server, which is a TCP server.
The implementation of it is on top of another generic one.
http://www.smalltalkhub.com/#!/~PharoExtras/RFB
I will look at it to extract error handling logic. I not look at it too much for now. But when I do I will put nice tests for this cases. Which is very important to me. Not only loop implementation duplicated in every servers but tests too (and most times no tests exists) ZnServer and subclasses have a quite robust implementation of server socket to connection handler logic with extensive error handling. All there in the standard image. But I assume you already looked at it.
-- . .. .. ^,^ robert
On 12/18/2015 01:37 PM, Sven Van Caekenberghe wrote:
On 18 Dec 2015, at 18:33, Robert Withers <robert.w.withers@gmail.com> wrote:
Hi Sven, I personally had not looked at Zinc. That's looking good. Therefore, I have a question about how to modify for my own client. You see, I implement a secure protocol that is different than HTTPS/SSL. I think you support SSL. How could I replace your rendezvous handshake with mine? I am looking for the secure state-machine entry point. Have a look at ZdcSecureSocketStream from the Zodiac package, which is a standard part of Pharo too (http://zdc.stfx.eu in particular http://zdc.stfx.eu/zodiac-paper.html). I think you are looking for #connect and #accept which are the setup hooks for the client and server respectively doing the setup.
I am taking a look and I have several comments. Firstly, is it using plugin calls to accept:/connect:from:to:into: to test for connected, then looping on reading encrypted data? It seems bound to tcp. I desire to run traffic over different interfaces so either roll my own stack or modify the internals of Zodiak. It seems it rests upon the SSL plugin, though. I will definitely be doing several scans over my implementation to cleanup the control and interaction with the transport. I see I will be looking heavily at the class you've mentioned. Thank you for the information, robert
ANother concern was which size frag packet and which size RS encdding, now that that is getting integrated.
Many thanks, and for SmalltalkHub registation, as well. Robert
On 12/18/2015 12:21 PM, Sven Van Caekenberghe wrote:
On 18 Dec 2015, at 18:17, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2015-12-18 16:43 GMT+01:00 phil@highoctane.be <phil@highoctane.be>: Hi Denis,
This makes me think about the VNC server, which is a TCP server.
The implementation of it is on top of another generic one.
http://www.smalltalkhub.com/#!/~PharoExtras/RFB
I will look at it to extract error handling logic. I not look at it too much for now. But when I do I will put nice tests for this cases. Which is very important to me. Not only loop implementation duplicated in every servers but tests too (and most times no tests exists) ZnServer and subclasses have a quite robust implementation of server socket to connection handler logic with extensive error handling. All there in the standard image. But I assume you already looked at it.
-- . .. .. ^,^ robert
-- . .. .. ^,^ robert
denis there is a chapter on socket in deep into pharo. Le 10/12/15 12:07, Denis Kudriashov a écrit :
Hi.
I need simple TCP server which process incoming connection in separate processes. I see Zinc ZnServer subclasses implement something like that. But I'm not sure that it is good idea to reuse it. Zinc server has http related methods which I'm not need.
What you think?
(I don't want to implement another one incoming connections loop)
participants (7)
-
Ben Coman -
Denis Kudriashov -
Hernán Morales Durand -
phil@highoctane.be -
Robert Withers -
stepharo -
Sven Van Caekenberghe