Mega Code Archive

 
Categories / Delphi / LAN Web TCP
 

Simple Thing to combine SocketServer (MIDAS socket connection) with our server app

Title: Simple Thing to combine SocketServer (MIDAS socket connection) with our server app Question: No Problem ;) Answer: As we know that Socket connection method in Midas implementation is the easiest way. No paintful configuration such as on DCOM. In Socket Connection method, Borland provides Scktsvr.exe to accept connection from client. The problem is (maybe only for me ;)), we have to bring this .exe to our customer. You may have problem to do that. Such as forget to Run this .exe before start the client app or maybe other things. The most case is human error or because of very lame customer ;) Well, thankful to Borland that they provide source code for Scktsvr.exe. What we do now is combine its source to our app. So we can just deliver single .exe (of course with other your files :)) to our customer. The point is we don't need this scksvr.exe for our app. You may take SocketServer source code in \delphi\source\vcl\ take these files : scktmain.pas and scktmain.dfm After that add these files to your project. Add this code to your project .dpr .................. SocketForm.Initialize(false); Application.Run; And if you want to manage the socket server just add this : SocketForm.showmodal; ;)) That's it. Enjoy ;)