[twsocket] SslWSocket client KeepAlive
Hello, What are the right parameters of the component for keeping the client alive, 1) KeepAliveInterval = ? 2) KeepAliveOnOff = ? 3) KeepAliveTime = ? What I would like to know is, What do you normally use and what is the best? Do you keepalive the connection by pinging the host or send messages let’s say every 5 minutes, how you keep it alive? Thanks -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocket client KeepAlive
> What are the right parameters of the component for keeping the > client alive, You asked this yesterday, and I answered. The KeepAliveOnOff parameters of the component are not necessarily reliable, it's better to send your own packets that you can see, particularly as you are creating your own protocol anyway. > keep alive the connection by pinging the host Ping is nothing to do with keeping a TCP/IP connection alive, it's to see if the remote host can be reached before you open a connection. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocket client KeepAlive
Thanks Angus, I now your answers of yesterday but, What are these for? 1) KeepAliveInterval = ? 2) KeepAliveOnOff = ? 3) KeepAliveTime = ? Are they there for what? Do we have any samples of keepalive? or do I just have to figure out how? I have never done anything like this before and looks like I won't be able of doing anything with out samples :( How the packet send is usualy done in ICS? I need samples! Thanks -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocket client KeepAlive
> Do we have any samples of keepalive? Have you tried searching all the ICS files, you will find it is used. Or use Goggle, this is simple TCP programming, nothing specific to ICS. > or do I just have to figure out how? Already answered twice. > I won't be able of doing anything with out samples :( If you want other people to write your programmes for you, you'll need to come to a commercial arrangement with them. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] FTPCli problem.
Hello Twsocket, I use the latest ICS v7 distributive. The problem happens on [not my] WinXP system with slow DSL connection. I cannot reproduce it on other PCs, so I gave that user a special version that writes logs to file. The problem is as follows: when the file is completely uploaded to FTP server, the program sometimes "hangs" until ftp.AbortAsync is called manually. Here is the final part of the log in normal situation: ... 15:13:38:799 DataSocketPutDataSent 32768 15:13:39:429 019559D8 TriggerDataSent 804 15:13:39:430 DataSocketPutDataSent 31535 15:13:39:912 019559D8 TriggerDataSent 804 15:13:39:912 DataSocketPutDataSent 0 15:13:39:912 019559D8 TCustomWSocket.Shutdown 1 804 15:13:40:057 ! Data Session closed 15:13:40:057 ! Next3PutAsync 15:13:40:058 019559D8 TCustomWSocket.Shutdown 1 804 15:13:40:061 >|226 Transfer complete| 15:13:40:061 ! Next3PutAsync 15:13:40:061 ! HighLevelAsync 0 15:13:40:061 ! HighLevelAsync done 15:13:40:084 019551B4 TriggerDataSent 832 15:13:40:227 >|221 Goodbye.| 15:13:40:227 019551B4 TCustomWSocket.Shutdown 1 832 And here is the log when the hanging occurs: ... 01:25:54:968 DataSocketPutDataSent 32768 01:25:55:765 00C45A34 TriggerDataSent 796 01:25:55:765 DataSocketPutDataSent 20016 01:25:56:281 00C45A34 TriggerDataSent 796 01:25:56:281 DataSocketPutDataSent 0 01:25:56:281 00C45A34 TCustomWSocket.Shutdown 1 796 01:25:56:453 ! Data Session closed 01:25:56:453 ! Next3PutAsync 01:25:56:453 00C45A34 TCustomWSocket.Shutdown 1 796 !!! The file is completely uploaded. Here the program hangs and the !!! user aborts the transfer: 01:30:05:062 ! Aborting 01:30:05:062 ! HighLevelAsync 0 01:30:05:062 ! Abort detected 01:30:05:062 ! HighLevelAsync done 01:30:05:093 ! Aborting So, the difference is that on the problematic PC the line 15:13:40:061 >|226 Transfer complete| is not always received or processed properly. What is the reason and how to fix this? PS: when the user runs the same program with ICS v5 component, it works on that problematic computer ALWAYS ok, i.e. it never hangs. -- Best regards, Antol mailto:spama...@mail.ru -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocketServer GET REMOTE COMPUTER NAME
Is there any built in procedure for getting the remote computer’s name? Yes and not. As you know you can get the remote IP address and having that IP, you can do a ReverseLookup to find out the hostname, if any, corresponding to that IP. A hostname (IP networking) is NOT a computer name (Windows networking). A computer behind a NAT router or a proxy server do not expose his own IP address to the outside world. if not, I will get the computer name from the client site and send it to the server as command when the connection is made. That is probably a better idea. Not the nothing prevent two persons to name their compter using the same computername ! Your software has probably to take care about that special case. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocket client KeepAlive
Have you tried searching all the ICS files, you will find it is used. Or use Goggle, this is simple TCP programming, nothing specific to ICS. Yes, I did and plenty of it. There are none documents which tells about how to in ICS and there are very few for Winsock. I won't be able of doing anything with out samples :( If you want other people to write your programmes for you, you'll need to come to a commercial arrangement with them. Making a sample code of a procedure is not making the program it is just a guide for where to start and how to start. A sample code is just what I need in order to be able to understand these things. A clear guide which tells about, If you need to send packets for keeping alive put the code into the procedure etc. Overbyte Wiki has very little info to use. If you thinks I am looking for a ready made application, means I have explained myself exremely badly!! -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocketServer GET REMOTE COMPUTER NAME
Thanks Francois, Your answer makes the ComputerName issue easier for me. The network will be controlled. Users won't be able to use duplicated names on their computers. I have asked because I have found --> "GetPeerName" in the component and wondering if possible. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] SslWSocketServer GET REMOTE COMPUTER NAME
I have asked because I have found --> "GetPeerName" in the component and wondering if possible. In socket terminologye (in general, not specific to ICS), "peer name" is the IP, port and protocol used by the remote. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] x64 adaptation
I recently reviewed all my projects to be ready to x64 (replaced things like Integer(Pointer) ) and also checked code of some components I use. The main idea is not to cast pointers/handles to integer/cardinal as they may exceed 4 bytes on x64 systems. Emb-ro introduced two new types: Native(U)Int that will always have the same size as Handle/Pointer. So I believe the changes could be done right now. Here's what I found in ICS. OverbyteIcsUtils.pas 1) if Integer(FHandle) >= 0 then // NativeInt() but not necessary as it's for old compilers 2) TIcsIntegerList.Get***, all Integer() casts 3) Cardinal(Pointer(Result)^) := Len; 4) if Cardinal(FHandle) = INVALID_HANDLE_VALUE then // (twice) to NativeUInt OverbyteIcsWndControl.pas 1) KillTimer(FIcsWndControl.Handle, Cardinal(Integer(IntPtr(FHandleGC; 2)if SetTimer(FIcsWndControl.Handle, Cardinal(Integer(IntPtr(FHandleGC))), FInterval, nil) = 0 then begin 3) KillTimer(FIcsWndControl.Handle, Cardinal(Self)); 4)if SetTimer(FIcsWndControl.Handle, Cardinal(Self), FInterval, nil) = 0 then begin There are other some Integer() stuff but inside IFDEF CLR sections and I have no idea on what things in x64 .Net are (and even if they differ from x32 at all). -- Anton -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] SocketSpy (2nd request)
Hi All, I have done a cbuilder translation of Mr. Mestdagh's SpocketSpy program. But, I have a problem. When I run the program and try to connect with a server, I get this immediate error: "An unknown response was received in response to a request for information from the news server 'SocketSpyC++ Local TCP Proxy'" Under the details button of the error dialog, I get: SocketSpyC++ Local TCP Proxy Configuration: Account: SocketSpyC++ Local TCP Proxy Server: 127.0.0.1 Protocol: NNTP Port: 119 Secure(SSL): 0 Code: 800ccca0 I don't have any idea what the problem is. First, while trying to debug, I put a popup messagebox at the end of the WSocketServerClientConnect procedure to take a look at a variable. What I discovered was that messagebox being open allowed the program to actually connect and go further before error. After that, I replaced the messagebox with an Application->ProcessMessages() loop as a test. I was amazed that after that, the program ran completely and reliably--everytime. It works just great, but I haven't tried more than 1 connection because of the ProcessMessages loop. Though the loop has been helpful, I doubt it is the appropriate fix for this. I'm wondering if this problem is somehow related to changes made to cbuilder in the 2007 edition I'm using. I have already discovered and fixed 2 other problems related to the 2007 upgrade. I'm using Vista64. My source code is included below. I hope you'll forgive me if I have included too much code. My program is 257 lines. Please have a look. Regards, Richard Christman https://www.quicksilvermail.net socketwins.h: // --- #ifndef socketwinsH #define socketwinsH // --- #include #include #include #include #include "OverbyteIcsWndControl.hpp" #include "OverbyteIcsWSocket.hpp" #include "OverbyteIcsWSocketS.hpp" #include // --- class TSocketWin : public TForm { __published:// IDE-managed Components TRichEdit *TCPLog; TStatusBar *StatusBar; TEdit *RemoteAddr; TLabel *Label3; TEdit *RemotePort; TLabel *Label2; TEdit *LocalPort; TLabel *Label1; TButton *ListenBtn; TWSocketServer *WSocketServer; void __fastcall WSocketServerClientConnect(TObject *Sender, TWSocketClient *Client, WORD Error); void __fastcall WSocketServerClientDisconnect(TObject *Sender, TWSocketClient *Client, WORD Error); void __fastcall WSocketServerSessionClosed(TObject *Sender, WORD Error); void __fastcall ListenBtnClick(TObject *Sender); private:// User declarations void __fastcall BgException(TObject *Sender, Exception *E, bool &CanClose); void __fastcall ClientDataAvailable(TObject *Sender, WORD Error); void __fastcall RemoteSessionConnected(TObject *Sender, WORD Error); void __fastcall RemoteDataAvailable(TObject *Sender, WORD Error); void __fastcall RemoteSessionClosed(TObject *Sender, WORD Error); void __fastcall RemoteDnsLookupDone(TObject *Sender, WORD Error); public: // User declarations bool cancel; TStrings *log; __fastcall TSocketWin(TComponent* Owner); __fastcall virtual ~TSocketWin(); void __fastcall Log(AnsiString Msg); }; class TClient : public TWSocketClient { public: AnsiString rcvd; TWSocket *remote; __fastcall TClient(TComponent *Owner); __fastcall virtual ~TClient(); }; // --- extern PACKAGE TSocketWin *SocketWin; // --- #endif socketwins.cpp: // --- #include #pragma hdrstop #include "socketwins.h" // --- #pragma package(smart_init) #pragma link "OverbyteIcsWndControl" #pragma link "OverbyteIcsWSocket" #pragma link "OverbyteIcsWSocketS" #pragma resource "*.dfm" TSocketWin *SocketWin; const AnsiString lineend = "\r\n"; const bool linemode = true; // --- __fastcall TSocketWin::TSocketWin(TComponent* Owner) : TForm(Owner) { log = TCPLog->Lines; } // --- __fastcall TSocketWin::~TSocketWin() { } // --- void __fastcall TSocketWin::ListenBtnClick(TObject *Sender) { if (ListenBtn->Tag == 0) { NNTPLog->Clear(); WSocketServer->Banner = "Welcome to OverByte ICS TcpSrv"; WSocketServer