question

Bob G avatar image
0 Likes"
Bob G asked Bob G commented

Socket Connection with HTTP

I have a question about connecting a FlexSim model to an HTTP server.

I currently have a model that uses sockets. FlexSim is the client with localhost and 1880 as the host name and port number, respectively.

Can an HTTP server be specifed in the clientconnect command via a URL? Something like: clientconnect(socketNum, HTTP://localhost.1880, portNum)

FlexSim 23.2.1
sockets
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Have you tried using the standard URL syntax to specify the port with Http.request ?

Http.request request=Http.request("http://locahost:1880")
1 Like 1 ·
Bob G avatar image Bob G commented ·

No, I did not try Http.Request.

I found some documentation for Http.Request in the Full Class Reference section of the User's Manual, but I have never used this class.

Would using Http.Request completely replace the current approach using sockets?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Bob G commented ·
I don't know - what have you got implemented on your webserver side?

You might find it useful to read Ben's answer on UDP/websockets (this is a link - like the documentation link in my post above).

0 Likes 0 ·
Bob G avatar image Bob G Jason Lightfoot ♦♦ commented ·

We decided to use the standard socket interface to connect the models, so a connection to an HTTP server through URL will not be needed.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Bob G,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

0 Answers