AnsweredAssumed Answered

vrf Server socket open and not block?

Question asked by jcmartin on May 8, 2003

Hi Burrell,

Until I know about VEE sockets, it works fine if VEE socket is the client, but if it is the server and the client cut the communications, VEE have problems.

Therefore, and taken into account that VEE socket is the client, you can generate an "On Cycle" loop to activate a To/From socket object. In the transaction you can use READ IO STATUS with a timeout of 0.05 or 0.1 seconds, for example, that is very quickly. The transaction IO STATUS provide you 1 if some data has been received an is available in the socket buffer or 0 if no data is available.

Logically, if IO STATUS is 1, then you can activate other To/From socket object to read all the requested information. In this way you can check if there are some new data into the cycle you want, without stopping the rest of VEE application. However, if you want an event of received data then you will need an ActiveX.

regards,




> -----Mensaje original-----
> De: BURRELL Benjamin [mailto:Benjamin.Burrell@tenix.com]
> Enviado el: jueves, 08 de mayo de 2003 7:30
> Para: VEE vrf
> Asunto: [vrf] Server socket open and not block?
>
>
> I have a project where I am communicating in both directions
> between VeePro and a TCL/TK application. Firstly the VeePro
> application is SENDING out update information to the TCL/TK
> program periodically. At any time a request for information
> could be SENT from the TCL/TK program to the VeePro
> application which the VeePro application will interpret,
> retrieve info from a DB and send the info back to the TCL/TK
> application.
> I have a listening/server socket in the TCL/TK program and a
> CLIENT socket in VeePro to handle the periodic updates as
> well as the replies to the requests mentioned above. The
> problem arises in how to handle these asynchronous requests
> from the TCL/TK. I would like a listening/server socket in
> VeePro and a client socket in TCL/TK. The problem is when I
> try to do this the server socket object in VeePro will block
> all threads in VeePro for the timeout period or until a
> connection occurs so the update information is not being sent
> out by VeePro by the client socket. Also if a request is sent
> by the TCL/TK program the VeePro server socket seems to
> connect, read the information and then closes the socket,
> while I would like it to stay listening for the next request.
>
> The only solution I can see is two have two copies on VeePro
> open with two separate applications. The first one has all
> the main functionality including the updating information
> function, while the second VeePro app. has just the server socket.
> The second VeePro app. is organised so that;
>              1) It listens for a request and if it times out
> waiting it will catch the time out error and restart
>              2) If a request has been sent it will connect,
> read from the socket and then will restart the server socket
> and wait for a request again.
>              3) The information received on the socket is
> written out to a external file.
>
> The first VeePro app. will poll the external file and check
> if it has been updated. If it has it will open the file, read
> it, clear it and close the file.
>
> Does anyone have any other ideas one how to get around this problem?
>
> Thanks
> Benjamin Burrell
>
>
> ---
> You are currently subscribed to vrf as: jcmartin@indra.es
> To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
> To unsubscribe send a blank email to
> "leave-vrf@it.lists.it.agilent.com".
> To send messages to this mailing list,  email
> "vrf@it.lists.it.agilent.com". 
> If you need help with the mailing list send a message to
> "owner-vrf@it.lists.it.agilent.com".
>

---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes