question

vigneshs avatar image
1 Like"
vigneshs asked Ben Wilson edited

Client server socket connection failing at socketinit()

The socket example here is failing at socketinit(). I'm not able to create a socket at port 8888. Any reason what should be done to create a socket and establish communication between client and server and send data between them. Can this be fixed ?

This model was built in version 7 and im using 21.3 version is that an issue?

reference: https://archive.flexsim.com/threads/thread3186.html

sockets_example.zip

FlexSim 21.0.3
flexsim 21.0.3serverclient
sockets-example.zip (27.9 KiB)
· 2
5 |100000

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

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

You might try this socket tutorial as an alternative to Logan's old forum post. It is also pretty old, though:

https://answers.flexsim.com/questions/84448/how-to-use-flexsim-socket-communication-with-serve.html


0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @vigneshs, was Ben Wilson 's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Ben Wilson avatar image
0 Likes"
Ben Wilson answered Ben Wilson edited

Hi @vignesh.s ,

I just tested the models in your .zip file using two local instances of FlexSim.

Everything worked fine for me.

You may already have some other service using port 8888. Try a different port. You'll need to change both models to use your chosen port number.

When I started the socket I received a prompt like this from Windows:

1628774745729.pngThat example above I just pulled off the internet, but the prompt I received was identical except for referencing FlexSim instead of Microsoft Teams. When I was prompted for what communication I wanted to allow for FlexSim, I chose to allow communication over all 3 network types.


1628774745729.png (294.9 KiB)
5 |100000

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