ServerSocket & Console App

Hello,

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

Thx Karamja
LVL 2
-Karamja-Asked:
Who is Participating?
 
shaneholmesConnect With a Mentor Commented:
//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
 
shaneholmesCommented:

 AServerSocket:= TServerSocket.Create(nil);
 
 SHane
0
 
-Karamja-Author Commented:
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
 
-Karamja-Author Commented:
Dont matter got it now,

var
AServerSocket: TServerSocket;

Thx For your help.
0
 
shaneholmesCommented:
OK, Let me know if you need anymore help!

Shane
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.