[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 444
  • Last Modified:

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
0
-Karamja-
Asked:
-Karamja-
  • 3
  • 2
1 Solution
 
shaneholmesCommented:

 AServerSocket:= TServerSocket.Create(nil);
 
 SHane
0
 
shaneholmesCommented:
//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
 
-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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now