how to use flexsim socket communication with server and client

how to use flexsim socket communication with server and client

luke_h
Not applicable
23 Views
4 Replies
Message 1 of 5

how to use flexsim socket communication with server and client

luke_h
Not applicable

[ FlexSim 19.1.2 ]

Hi, i've been trying to use the worked examples from @Logan Gold on using a server and a client via using sockets but after trying to run the example not much seems to happens on my software with it not returning a 1 to show the client has connected, i kept his code with only changing the ip address and port to my own can someone please show me where i've gone wrong or where the values would be returned to as no console pops up showing these values

0 Likes
Accepted solutions (1)
24 Views
4 Replies
Replies (4)
Message 2 of 5

regan_blackett
Autodesk
Autodesk
Accepted solution

@Luke H

I used this document about 6 years ago to to build a training module for using socket connections. Maybe this will help.

https://cloud.flexsim.com/index.php/s/o9QEyNvcDyfznWK

0 Likes
Message 3 of 5

luke_h
Not applicable

thank you this was quite helpful but can you clarify where the value of 1 would be displayed when the connection is made

0 Likes
Message 4 of 5

regan_blackett
Autodesk
Autodesk

You mean the value returned by serveraccept()? It's a value returned by the function and so needs to be stored in a variable like:

int client = serveraccept(0);

"client" now stores the result of whether or not a connection was made (1 for true, 0 for false)

0 Likes
Message 5 of 5

Ben_WilsonADSK
Community Manager
Community Manager

Attaching the document directly in case the link ever dies in the future:

Creating a Socket Connection in FlexSim.pdf