Re: Using WIDGET_ACTIVEX to create a Socket server [message #48810] |
Tue, 23 May 2006 20:08 |
bsoher
Messages: 5 Registered: May 2006
|
Junior Member |
|
|
So now I'm replying to my own posts.
If anybody is interested in creating a non-blocking socket server in
IDL, I found a solution to my own question. Turned out to be a problem
with the ActiveX socket library I was using. I downloaded a different
library (Catalyst's SocketWrench Standard Edition v4.5), and the
ActiveX events now work fine with the IDL events.
I'd be happy to share test code with anybody that is interested. You
can contact me at brian.soher@duke.edu
Thanks
Brian.
|
|
|
Re: Using WIDGET_ACTIVEX to create a Socket server [message #48815 is a reply to message #48810] |
Tue, 23 May 2006 09:50  |
bsoher
Messages: 5 Registered: May 2006
|
Junior Member |
|
|
Thanks for the info about v6.3, but for the time being I am stuck using
v6.1. Also, I was hoping to create an event-driven server application.
Specifically, I have a client application in C++ that takes data from a
spectrometer at fixed time intervals. I want the client to ship that
data to my server which will display it in a widget AND allow the user
to interact with all the data thus far received in between receiving
new data on the server.
I'd read that the ActiveX libs fire off events when clients attach,
send data, terminate, etc. So, I'd hoped that this could be combined
with IDL's standard widget handling to create a non-blocking widget
"listener". I just can't get IDL to hear and react to the ActiveX
events (which are supposed to be bound to the WIDGET_ACTIVEX object).
codepod@gmail.com wrote:
> This isn't documented (it's somewhat experimental), but if you have 6.3
> you can create a server socket in IDL. To do this you do the following:
>
> ;; First create a socket, but market it as a listener.
> ;; socket, <lun>, port, /listen
>
> ;; Then accept a connection on this socket.
> ;; This will listen on the above port (8081).
> ;; This blocks until a connection is made
> ;; Socket, <lun 2>, accept=lun
>
> ;; Once the above routine returns, you can read and write
> ;; the socket that accepted the connection. In this example,
> ;; using lun 2.
>
> ;; when complete, just close the units.
>
> -CP
|
|
|
Re: Using WIDGET_ACTIVEX to create a Socket server [message #48820 is a reply to message #48815] |
Tue, 23 May 2006 07:26  |
codepod
Messages: 19 Registered: March 2006
|
Junior Member |
|
|
This isn't documented (it's somewhat experimental), but if you have 6.3
you can create a server socket in IDL. To do this you do the following:
;; First create a socket, but market it as a listener.
;; socket, <lun>, port, /listen
Socket, 1, 8081, /listen
;; Then accept a connection on this socket.
;; This will listen on the above port (8081).
;; This blocks until a connection is made
;; Socket, <lun 2>, accept=lun
Socket, 2, accept=1
;; Once the above routine returns, you can read and write
;; the socket that accepted the connection. In this example,
;; using lun 2.
printf, 2, 'cow'
data= ''
readf, 2, data
;; when complete, just close the units.
-CP
|
|
|