Solved

Getting Data from a TServerSocket

Posted on 2001-07-26
5
207 Views
Last Modified: 2010-04-06
I have a TServerSocket that I am connecting to from a different machine using a TClientSocket. The TServerSocket Listens fine, then Connects and Accepts when the TClientSocket is set to Active. However when I use TClientSocket.Socket.SendStream to send out information the TServerSocket does not fire its OnClientRead event as I have been lead to believe it is suposed to. As far as I know the place to process the data comming from the TClientSocket is in the OnClientRead event. Am I missing something simple or have I got the process wrong? Any advise would be appreciated.
0
Comment
Question by:Siband
  • 3
5 Comments
 
LVL 21

Expert Comment

by:gemarti
ID: 6321866
Is your ServerSocket.Active Set to true?

Are the Ports set correctly? (i.e. Ports = 1024)

Does the ClientSocket know what host is supposed to be talking to?

0
 
LVL 1

Accepted Solution

by:
h_mohsenian earned 50 total points
ID: 6322208
I think that is better at first you test ur application by SendText ( not SendStream ) and for learning the details see the Char Delphi standard Demo ( in folder Demo\Internet ) It is a good app and I started using TServerSocket & TClienSocket by this Demo!

best regards
hamed
0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6322214
oh, chat demo not char demo ;-)
0
 

Author Comment

by:Siband
ID: 6322917
I have actually sorted it out myself. (I had not been setting my TStream position back to 0 before trying to send it - D'oh!!). However had I not spotted this, I think your sugestion would have been the best way forward so I'm awarding the points quickly before too many other people catch on to my stupidity!
0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6325537
:-) thanks and good coding ;-)
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

Title # Comments Views Activity
how do i create updater to My Activex application? 3 79
loading dll from external path 1 209
Delphi XE10 Round Image 2 75
Convert MS Word document to a PDF file 9 60
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

937 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

7 Experts available now in Live!

Get 1:1 Help Now