Jump to content

merijnb

Members
  • Content Count

    37
  • Joined

  • Last visited

Community Reputation

4 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Well even if they are part of the problem, it might be to deep in the call stack to make sense. If most of the time goes to allocating memory, I'd like to know which parts of my code is allocating memory. I can look at all the calls tot GetMem and check their callstacks, but I'd rather just filter out system.pas overall. V-Tune does know which unit the call came from, so I'm surprised that it doesn't seem possible to filter in that way?
  2. Inspired by @Stefan Glienke's talk on the Delphi Summit in Amsterdam I've tried using the v-tune profiler. We had a performance issue and solved it, and I tried using that case to 'reverse test' using v-tune. In other words, I already know what the issue was, how could I have found this using v-tune? The issue I'm running into is that there is too much noise to see what I'm looking for, I understand that (for example) EurekaGetMem (from Eurekalog) is called many times, but that's -at this point- not interesting to me. I'd like to filter on certain source files, like tell me what took the most times if you only look at the code I've written, nothing from Delphi, Eurekalog, FastMM, etc. Is this possible?
  3. While updating to 12 I found out this feature request is still open, so I patched my GX_OtaUtils and build a new DLL locally. Can I get these changes into the trunk somehow for the future? I've attached a the newly patched version on sourceforge again.
  4. merijnb

    shortcut keys prev/next identifier reference

    @Brian Evans I use cnpack next to gexperts, but have been doing so for years, so no idea why that would be a problem now. Also, the keys don't actually seem to do something when gexperts can't use time. I understand @dummzeuch proposal is the easiest solution, for me currently also the least desired one though 🙂 I'll keep poking to see if I can find the cause.
  5. I don't think this is a gexperts problem, but this might be the best place to look for info. Since upgrading to 11, the shortcut keys to previous and next identifier reference (ctrl alt up and ctrl alt down) keep breaking. When I look in the configuration, they're still there and when I reset them (as in, set them again), they work again, after a reboot it's broken again. Anyone a tip how to solve this?
  6. I can't find it where, but somewhere I read Embarcadero accepted this being a bug in the IDE, I hope it's fixed soon because it's really annoying.
  7. Hey Angus, I have no need for the name (I wondered why it was set), the reason THttpAppSrv doesn't have this error is because the class definition is not part of another class definition.
  8. I just noticed the title of this thread isn't what it's supposed to be, it should be bug in OverbyteIcsHttpSrv.THttpServer.Create 🙂
  9. One of the first things the constructor of THttpServer does is setting FName of FWSocketServer, using the current ClassName as a basis: constructor THttpServer.Create(AOwner: TComponent); begin inherited Create(AOwner); CreateSocket; {$IFDEF NO_ADV_MT} FWSocketServer.Name := ClassName + '_SrvSocket' + IntToStr(WSocketGCount); {$ELSE} FWSocketServer.Name := ClassName + '_SrvSocket' + IntToStr(SafeWSocketGCount); The name of a component can only consist of 'A'..'Z', 'a'..'z', '_', '0'..'9' as can been seen in System.SysUtils.IsValidIdent() (called from System.SysUtils.TComponent.SetName()) If you define a class, overriding form THttpServer as part of another class: type TMyClass = class(TObject) private type TMyHttpServer = class(THttpServer) The ClassName of TMyHttpServer will become TMyClass.TMyHttpServer, so it contains a dot, hence breaking the constructor of THttpServer. Fix could be to do a StringReplace() to eliminate dots in the constructor: constructor THttpServer.Create(AOwner: TComponent); begin inherited Create(AOwner); CreateSocket; {$IFDEF NO_ADV_MT} FWSocketServer.Name := StringReplace(ClassName + '_SrvSocket' + IntToStr(WSocketGCount), '.', '', [rfReplaceAll]); {$ELSE} FWSocketServer.Name := StringReplace(ClassName + '_SrvSocket' + IntToStr(SafeWSocketGCount), '.', '', [rfReplaceAll]);
  10. I totally agree, unfortunately in this case I don't have any other option.
  11. If I see correctly ReuseAddr isn't used, that means that TFtpClient itself cannot be the cause of reusing a port, you agree? As I said, I have ways around this, this is more to satisfy my curiosity. When you say I'm not using the component properly, what do you mean exactly? It's now allowed to use multiple instances of TFtpClient at the same time? I understand there are ways around this, but is there a technical reason you say this?
  12. Apologies, I thought that was clear by now. Your description is about right, this application will at some point need to upload a file to an FTP server, at that point it will create an FTPClient object and start the upload. In a specific case active FTP with a specified port range is required, and then we ran into this interesting behavior. I don't think that will really solve the issue since (at least for me) it's not clear yet how this is happening in the first place. If I debug this I can see clearly that every time one of the clients tries to decide what port to use (at the moment PORT command should be sent), it will try to start listening on the first port in the range, if it fails (since already in use) it will try the next. The principle in code seems to be ok. Yet somehow there seems to be a gap between a socket calling Listen() and that port actually being unavailable for another socket to listen on, at least, that is the only way I can imagine two separate FTP client instances will give the same port to the server to make the data connection on. To me it seems there are two strange things about this: 1) how is it possible that two clients give the same port to the server for the active connection, that implies that two sockets were able to listen on the same port simultaneously which is not possible. 2) how is it possible the file transfers (seem) to work (see the wireshark logs). The only thing I can imagine is that FTP client 1 starts his data socket listening on port A, FTP client 2 for some reason (see point above) thinks he's also listening on port A, the server makes two connections back, both on port A, and they both actually connect to the listening socket from FTP client 1 (as far as I can see there is no check how many clients connect to the listening socket started by the FTP client). This kind of makes sense from socket perspective, but makes no sense at all from application perspective, that could never work (how would FTP client 1 be able to handle both data streams). Now I can work around this in several ways, so this question is more out of interest (I see a learning opportunity here), what the heck is going on here 🙂
  13. No, it's one application. Queuing is a possibility (or a fall back), but why? There is no technical reason to do so. Multiple files can be uploaded simultaneously without problems.
  14. I'm uploading files to an FTP server, these uploads are triggered from outside of my app and handled by a single thread. Each trigger will start up an FTP client to upload a single file.
  15. I'm currently in the situation where I'm using an active FTP client while setting a port range for the data connection. If a port range is given, the TCustomFtpCli.PortAsync() method in OverbyteIcsFtpCli will see which of the ports is available from given range, simply by trying to start a listening socket on the first port, go to the next if that excepts, etc. During tests we have seen the strange behavior that when we start multiple FTP connections in rapid succession, it sometimes happens that multiple clients pick the same port for the data connection (so for example client b picks the same port as client a, while client a is still using that port). It's a bit hard to replicate in a consistent way, but the smallest I've been able to make it is by making an application which creates three TFtpClient objects, let them all connection to the same server, set to active FTP with a port range (7000-7010) to upload a small file. This happens from a single thread. Something needed for this to happen seems timing related, I've not been able to reproduce this with an FTP server from ICS, but I did with Filezilla server. Obviously it shouldn't matter that much, since the port used for the data connection is chosen by the client, not the server. I'm quite at a loss how this can happen, for two reasons: The code in PortAsync() tries to setup a listening socket for each connection, apparently it's sometimes able to setup 2 different listening sockets on the same port, how is this possible? How is it possible that (besides there are two sockets listening on the same port) it's actually possible to get data to the two different listening sockets while they're listening on the same port, how does the tcp stack in Windows know for which of the two sockets the data should be sent to? I've added a zip file with logging from both the server and clients from my test, in it there is logging from filezilla server, a wireshark capture from the server's perspective, application log from the three clients (things like OnDisplayMessage from the TFtpClient), ICS log from all three clients (ICSLogger) and a wireshark capture from the client machine. Besides I'm really curious what I'm missing here I wonder if this is a bug in ICS code (how is it possible it's able to start two listening sockets on the same port) and if it's something I should be worried about. Thanks in advance, I'm really curious what comes out of this 🙂 ftp test log.zip
×