EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Passing a socket handle to a TElSocket object

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 05/20/2014 20:31:55
by Erich Kuba (Standard support level)
Joined: 05/16/2013
Posts: 38

Hi there,

I am in the process of replacing Synapse TCP Blocking Socket objects with your TElSocket objects due to my desire to move to the mobile platforms (I have purchased both VCL and NG Editions of SBB)

Synapse allowed me to pass a socket handle to a newly instantiated Synapse Socket object by setting the .Socket property on the new socket object with the socket handle. That would effectively allow me to move the processing into a thread and allow my listening socket to listen for more connections;

How do I do this with TElSocket?? I've looked at your source code and I see that there is a read only property called NativeSocket. Thats probably what I'd want to be setting.

Any thoughts on how I could achieve this?


Posted: 05/20/2014 22:43:18
by Erich Kuba (Standard support level)
Joined: 05/16/2013
Posts: 38

Please ignore my question ... I've figured it out
Posted: 05/21/2014 00:32:56
by Eugene Mayevski (EldoS Corp.)

For you and for others (as this is a public forum):

you can not pass the socket handle because TElSocket keeps certain information about socket state, address etc. in its internal properties.

However in your situation you can use TElSocket's Listen and Accept methods to accept incoming connections. Accept returns a new instance of TElSocket with accepted connection (and this TElSocket can be passed to other thread for processing), so you don't need to set a socket handle.

Sincerely yours
Eugene Mayevski
Posted: 05/21/2014 00:42:59
by Erich Kuba (Standard support level)
Joined: 05/16/2013
Posts: 38

Yip ... That's exactly what I did ... Thanks



Topic viewed 377 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!