Solved

Delay in TClientSocket and TServerSocket Components....

Posted on 2001-08-03
6
394 Views
Last Modified: 2010-04-06
I'm new to TClientSocket and TServerSocket Components in Delphi 4.  What I tried to do was a simple program just connecting and sending a simple string message from client exe to server exe via winsocket.  However, either connection or sending message was incredibly slow, taking a few seconds.  It wasn't like it in VB or VC++.  Am I making some mistakes using these components?  

Could anyone help?  

0
Comment
Question by:skyrider_tieus
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6351357
there is a good Demo for Using TServerSocket & TClienSocket in Delphi. see Demoes\Internet\Chat\Chat App. it used SendText for sending Message.

best regards
hamed
0
 

Author Comment

by:skyrider_tieus
ID: 6360735
hamed:

Thanks for the tip.  Sending string message was OK, but the connection was still slow.  The demo program had some bugs.  If two instances were running in the same machine, an error message would appear 'Windows socket error (10048), on API bind'.  Despite this error message, they still worked except for the slow connection.  When an instance exited, another error message showed up saying 'Access violation'.  I was running two instances on the same PC.  Is there a way to expidite the connection?

James
0
 

Author Comment

by:skyrider_tieus
ID: 6360885
This issue is solved.  TCustomWinSocket.remotehost property would take a while to resolve the remote host name.  The winsocket would run much faster without invoking this property.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 6361167
Points have been refunded.  This is now moved to our PAQ.
Moondancer
Community Support Modertor @ Experts Exchange
0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6362714
hi skyrider_tieus , i am glad that you find your need, but about demo bug :

if i understand right , you say : if you run two of this demo App in one computer and when you want to connect , an error is happend, i think it is not a bug becouse each app want to get Net stream in the same port , it means to process want to use the one resource , it must be make error. it is not a bug , this a app work when you have a Lan for example and each app runs with each computer with determined IP .

if i am in wrong way about understanding your mean please tell me!

why you want to exec two App in one PC , is a test simulation?

best regards
hamed
0
 

Author Comment

by:skyrider_tieus
ID: 6365870
hamed:

Thank you again for the follow-up comment.  Yes, you are right about the cause of the first error, which occurs owing to two instances competing for the same resource.  I am still unware of what has caused the second error. I guess when Inprise developed this demo they did not take this case into account.  The chat program should run astride the LAN.  

Yes, it is a test simulation for inter-process communication between two programs with different programing languages.  Winsocket is not the best means though, it is the quickest and simplest.

James
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now