Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ServerSocket & Console App

Posted on 2004-03-21
5
Medium Priority
?
441 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 960 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 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