| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Please help with winsock |
Hi,
I want to develop two applications that will automatically begin to
talk to each other via winsock if they are both started up. I want to
develop it so that no timers are involved in initiating communication.
The way I thought it would work is that each application would have
three winsock controls on its form. On the form load event of both
applications, each would listen out on a different port for incoming
messages (e.g. A on 4000 and B on 4001). At the same time one of the
other winsock controls on each form would try to connect to the other
app on different ports. For example, in app A I might have
wskListen.LocalPort = 4000
wskListen.Listen
wskSend.RemotePort = 4001
wskSend.RemoteHost = "127.0.0.1"
wskSend.Connect
and on app B I'd have
wskListen.LocalPort = 4001
wskListen.Listen
wskSend.RemotePort = 4000
wskSend.RemoteHost = "127.0.0.1"
wskSend.Connect
(The third winsock control on each app is there to accept connection
requests so isn't important.)
Depending on which app was started first there would always be an
application listening and when the other was started then there would
be a connection. On the connect event of that winsock control, I'd
send a message to the port on which the other application was
listening asking it to retry connecting. This works okay if I start
either app A or B first. However if I close one of the applications
and start it again connection is never reestablished. I get a
"Connection is aborted due to timeout or other failure" error. I have
to end both applications in order for them to start communicating
again. Has anybody managed to achieve something like this.
Thanks,
Paul
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com
---
* RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
* RgateImp.MoonDog.BBS at 5/24/04 12:38:14 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)SEEN-BY: 633/267 270 @PATH: 278/230 10/345 106/1 2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.