Simple Socket Exceptions

Hi Rooters,
I have been running into TSocket exceptions in my compiled code. The same problems sometimes happen in the tutorials\net\pserv.c example. Running pserv.c and pclient.c under XP with version 5.18 (starting in the tutorials\net directory) I often get the following results:

root [0] .x pserv.c
Receive 100 buffers of 500000 bytes over 5 parallel sockets…
SysError in TWinNTSystem::WinNTRecv: recv (No such file ordirectory)
Error in TWinNTSystem::RecvRaw: cannot receive buffer
error receiving
50000000 bytes received in 3.687000 seconds
12.75 MB/s
root [1]

root [0] .x pclient.c
Error: C++ exception caught C:\root\tutorials\net\pclient.c(24)
Warning in TWinNTSystem::Run: handle uncaugth exception, terminating


Here are two other somewhat strange (cint?) details:

  1. Pressing the cursor up button in the second window gives me the last root line typed in the first window.
  2. The client exception may take up to a minute to occur
  3. I have seen the uncaughth (sic) exception on the server side as well.

My compiled code is based on hserv2 but behaves similarly. Are there things I can do in my compiled code (running from VC++) to prevent this?

Steve Alam


Could you try with latest version (5.22) and let me know, please?

Cheers, Bertrand.

5.22 behaves better and hserv behaves better still :slight_smile: - there are no errors reported. Unfortunately with 5.22 my compiled code now freezes. I will debug and continue this thread if I cannot find the problem.

Hi Again,
My compiled code was fine - just forgot what I’d done last.
With 5.22 I still see the message:
SysError in TWinNTSystem::WinNTRecv: recv (No error)
when my client closes prematurely.
I also now have two VC++ complaints that -FI"w32pragma.h" doesn’t catch:
1>c:\root\include\ttimestamp.h(121) : warning C4244: ‘initializing’ : conversion from ‘const time_t’ to ‘Int_t’, possible loss of data
1>c:\root\include\ttimestamp.h(125) : warning C4244: ‘initializing’ : conversion from ‘time_t’ to ‘Int_t’, possible loss of data
The cursor up arrow still repeats the last line typed in the root console window opened before it - maybe this is a feature. I can very easily live with all of this.