HMBatch as server
Hi all,
I wanted to launch hypermesh as a server and my client will send various requests to the server.
***********************************************************************************************************************************
SERVER CODE : HM_Server.tcl
***********************************************************************************************************************************
I'm launching the hmopengl.exe using ShellExecuteEx method.
***********************************************************************************************************************************
CLIENT CODE
***********************************************************************************************************************************
The above code is working fine with hmopengl.exe
where as it is not working with hmbatch.exe [ ShExecInfo.lpFile = TEXT('C:\\Program Files\\Altair\\12.0\\hm\\bin\\win64\\hmbatch.exe') ];
I could not find the issue...
Answers
-
Hi
I do not ever use hmbatch. but i guess perhaps it use tcl shell (not wish app like in hm), you may need vwait to enter event loop
anyway, I see your client invoked server code, why?
client should access server via socket $serverIP 30000
and if you already test on hm before, the port may not be used again by hmbatch server. Using free port is recommended
and don't forget flushing channel
If you are communicating between different hypermesh session on one pc, you can use dde facility, it is more simple than socket
/emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>
0 -
Hi
the Port 30000 is free one. Because I'm able to use that port with hmopengl.exe and it is being closed properly. But sill as you said, I'll try to make use of the free port.
Even I tried to use vwait but I dont see the function 'Server' is called at all while making the connection from the client.
0 -
I'm curious to know how you work in 'client-server' mode.
0 -
do you flush the channel???
forexample
#client code
set chan [socket $ServerIP 30000]
puts $chan 'Hello, this is client'
flush $chan; #now server can get greeting and reply
Remember than: set chanID [socket -server Server 30000] , this chanID is not used to communicated to client, you have to remember client channel within 'Server' procedure.
But you can use it to retrieve IP: set IP [fconfigure $chanID -sockname]
0 -
Altair Forum User said:
Hi all,
I wanted to launch hypermesh as a server and my client will send various requests to the server.
********************************************************************************************************
SERVER CODE : HM_Server.tcl
....If you like to do that, why need write ... your server with TCL?
At your place, I'll use a web server, like Apache, with PHP/Perl. A simple web form to send data and at server just run the job.
0 -
I think babu_rect wants to do some simple tasks by tcl because it's embedded into hw
0