Network Help
Paul G
Posts: 10
I am trying to use the PropTCP driver with a Gadget Gangster E-Net module. I have the demo webserver program running so I know the hardware works.
Ultimately what I want to do is to have the prop connect to a (PC based) server, send a piece text and read a valid / invalid result back from the server.
1) Is it possible to try and connect to an IP address and have it succeed or fail depending on whether there is a server listening or not ?
2) Am I using the correct unit for this (api_telnet_serial) or is there something more appropriate ?
3) Has anyone done this or can point me in the right direction or offer some sample code ?
Thanks
Paul
Ultimately what I want to do is to have the prop connect to a (PC based) server, send a piece text and read a valid / invalid result back from the server.
1) Is it possible to try and connect to an IP address and have it succeed or fail depending on whether there is a server listening or not ?
2) Am I using the correct unit for this (api_telnet_serial) or is there something more appropriate ?
3) Has anyone done this or can point me in the right direction or offer some sample code ?
Thanks
Paul
Comments
Any help would be really appreciated.
Paul
a) There was a delay between calling the .start method and the .connect method
b) The .connect method is within the loop of the program so that pressing a key will re-try the connection.
Now, the first connection attempt invariably fails but subsequent attempts (mostly) work fine.
Tom
As I understand the code, the enet.WaitConnectTimeout(2000) loops until either the connection is made or the timeout (of 2000 mS) elapses. I have tried longer values without success.
Once the initial failure is out of the way, the connection occurs virtually immediately.
Paul