Solved

Delay in TClientSocket and TServerSocket Components....

Posted on 2001-08-03
6
407 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
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!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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