15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CSocket inter application communication

Jason R. Simpson -- doecreek@tir.com
Saturday, August 03, 1996

Environment:  VC++ 1.52, Windows for Workgroups 3.11, Windows 95

I have two MFC applications that use a CSocket implementation based on =
the CHATTER and CHATSERVER programs found in MSDN code samples.  =
Obviously, one application is the server and the other is the client.

The server has two purposes.  It has two listening sockets; one listens =
for connection requests from a badge terminal and the other listens for =
the client application.  The server retrieves information from the badge =
terminals as people swipe badges.  The server also processes requests =
from the client application for items such as retrieving the data =
collected from the terminals, sending configuration to the terminals, =
etc.

The client application has one client socket that immediately attempts =
to connect to the server upon execution.

Here is the problem:  The applications run flawless in Windows 95, but =
under Windows NT or Windows for Workgroups 3.11, the client always =
receives the WSAECONNREFUSED error message when trying to connect.  The =
server can connect to the badge terminals while running under NT or WFW, =
but the client cannot connect.  I have tried all of the obvious =
including verifying IP addresses, making sure that no other services are =
running on the port that I have selected, etc.

I will be more than happy to elaborate on my coding methods or other =
details on request and any suggestions will be appreciated.

Jason Simpson
TimeTrak Systems, Inc. 



Bharat Gogia -- gogiabd@batelco.com.bh
Tuesday, August 06, 1996

[Mini-digest: 2 responses]

The method used CHATTER to connect to server is by using name of the
server, i.e.
it uses gethostbyname(). It seems that MS TCP on Win3.11 does not support
that. Win95 and WinNT 3.51 does not have any such problems, I tried on
both.
__________________________________________
Bharat Gogia
Project Manager
01 Systems w.l.l.

I don't suffer from insanity.  I enjoy every minute of it.
___________________________________________

----------
From: Jason R. Simpson 
To: 'mfc-l@netcom.com'
Subject: CSocket inter application communication
Date: Saturday, August 03, 1996 6:54 PM

Environment:  VC++ 1.52, Windows for Workgroups 3.11, Windows 95

I have two MFC applications that use a CSocket implementation based on the
CHATTER and CHATSERVER programs found in MSDN code samples.  Obviously, one
application is the server and the other is the client.

The server has two purposes.  It has two listening sockets; one listens for
connection requests from a badge terminal and the other listens for the
client application.  The server retrieves information from the badge
terminals as people swipe badges.  The server also processes requests from
the client application for items such as retrieving the data collected from
the terminals, sending configuration to the terminals, etc.

The client application has one client socket that immediately attempts to
connect to the server upon execution.

Here is the problem:  The applications run flawless in Windows 95, but
under Windows NT or Windows for Workgroups 3.11, the client always receives
the WSAECONNREFUSED error message when trying to connect.  The server can
connect to the badge terminals while running under NT or WFW, but the
client cannot connect.  I have tried all of the obvious including verifying
IP addresses, making sure that no other services are running on the port
that I have selected, etc.

I will be more than happy to elaborate on my coding methods or other
details on request and any suggestions will be appreciated.

Jason Simpson
TimeTrak Systems, Inc
----------

-----From: pierardi@pumatech.com


     Jason,
     
     As I recall, the CHATTER and CHATSERVER programs rely upon the MFC - 
     generate port # for the client socket.  I remember the 
     CSocket.Create() call allows a zero or null parameter for the port 
     specification telling MFC to choose the next available port. 
     I think the listening socket was given something like 701.  Try giving 
     the client socket a static port.  Make sure that you can PING the 
     hosts from each other. Also, make sure you have entries in the 
     SERVICES file for Win 3.x and WinNT 3.5x ( found in 
     c:\Winnt35\system32\drivers\etc directory ).  
     Win95 doesn't require this.
     
     
     Good Luck !
     
     Peter Ierardi
     Software Evolution, Inc.



Doug Boone -- dboone@fasttax.com
Wednesday, August 14, 1996

I've always found that WSAECONNREFUSED meant that there was a machine at
that address, with TCP/IP loaded, but no one was listening on the specific
port. (A bogus address returns as WSATIMEDOUT)

A firewall blocking the port from some machines?  An invalid port?
Listening port is not creating new sockets fast enough to handle inbound
connection requests?

Look at the configuration under Win95 versus Windows NT. Are the client
addresses the same? Gateways the same? DNS/WINS/whatever the same?

The only thing I've seen about sockets that was specific to platform was
that you can't duplicate a CAsyncSocket under Win95.





| Вернуться в корень Архива |