?
Solved

Delay in TClientSocket and TServerSocket Components....

Posted on 2001-08-03
6
Medium Priority
?
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 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