Solved

Getting Data from a TServerSocket

Posted on 2001-07-26
5
206 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
Comment Utility
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
Comment Utility
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
Comment Utility
oh, chat demo not char demo ;-)
0
 

Author Comment

by:Siband
Comment Utility
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
Comment Utility
:-) thanks and good coding ;-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
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.

743 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

15 Experts available now in Live!

Get 1:1 Help Now