Solved

Delay in TClientSocket and TServerSocket Components....

Posted on 2001-08-03
6
399 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

17 Experts available now in Live!

Get 1:1 Help Now