Solved

ServerSocket & Console App

Posted on 2004-03-21
5
432 Views
Last Modified: 2010-04-05
Hello,

How can I use ServerSocket's in a console app, Or somethink like ServerSocket that can be used in console app.

Thx Karamja
0
Comment
Question by:-Karamja-
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10643682

 AServerSocket:= TServerSocket.Create(nil);
 
 SHane
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 240 total points
ID: 10643692
//create the server socket
 AServerSocket:= TServerSocket.Create(nil);
 //set its port
 AServerSocket.Port:= 1024;
 
//set its events - note: You will have to create this methods yourself, and assign them to the events
//here are three example events. You may want to use other events available as well. See help
 AServerSocket.OnClientConnect:= MyClientConnect;
 AServerSocket.OnAccept:= MyAccept;
 AServerSocket.OnListen:= MyListen;

 //set active = true
 AServerSocket.Active:= True;

Shane


Shane
0
 
LVL 2

Author Comment

by:-Karamja-
ID: 10643700
Where do I put this code and how to I use it. Remember im making a console app.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

begin

end.
0
 
LVL 2

Author Comment

by:-Karamja-
ID: 10643713
Dont matter got it now,

var
AServerSocket: TServerSocket;

Thx For your help.
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10643720
OK, Let me know if you need anymore help!

Shane
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 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