Recent

Author Topic: Synapse TCP/IP client and server(Second Edition)  (Read 9949 times)

balazsszekely

  • Guest
Re: Synapse TCP/IP client and server(Second Edition)
« Reply #15 on: April 04, 2023, 05:18:19 pm »
a TimeOut property on the client would be very good for networks with high latency on the server and low connection on the client
so we could control the connection timeout.
There is a ConnectionTimeout constant in unit uTCPSockets(default 5000 ms). Please increase it, then rebuild the client.

ianr42

  • Newbie
  • Posts: 1
Re: Synapse TCP/IP client and server(Second Edition)
« Reply #16 on: February 11, 2024, 04:04:45 am »
I just wrote my own server - nowhere as good as this one - and have been having trouble with flushing sockets.

So I thought I'd download this one and give it a go to cross check (and I agree with the older comments that it would be great to have this up in git somewhere!).

It has a line in uTCPSockets (line 428) that says
Code: Pascal  [Select][+][-]
  1.  FBlockSocket.ConnectionTimeout := ConnectionTimeout;

The problem is that FBlockSocket - which is a TTCPBlockSocket - has no member called ConnectionTimeout  - either directly or inherited. Well, not in my current synapse version, or on http://synapse.ararat.cz/doc/help/blcksock.TTCPBlockSocket.html

I can, of course, comment out the line - but I'd be curious to know what version of synapse had that as a variable, or has the synapse library been edited for this project?



rca

  • Full Member
  • ***
  • Posts: 124
Re: Synapse TCP/IP client and server(Second Edition)
« Reply #17 on: July 09, 2025, 08:58:50 pm »
I'm sending a simple test file, "test.txt", from the server to the client.

The first time it sends without any problems, but when I try to send it again, the following error message appears on the server:
Code: Text  [Select][+][-]
  1. Error sending message "READY" : Other Winsock error (32)(32)

And on the client side:
Code: Text  [Select][+][-]
  1. Connection reset by peer(104).

I'm using the fixes branch of Lazarus 4 and fixes FPC 3.2.
Ubuntu 24.04 64-bit.

How can I fix this?

Thaddy

  • Hero Member
  • *****
  • Posts: 18961
  • Glad to be alive.
Re: Synapse TCP/IP client and server(Second Edition)
« Reply #18 on: July 09, 2025, 09:04:07 pm »
By not using Synapse but the code from fpc-web/net?
Btw, that is not absolutely necessary, but it is necessary that your security protocols are up-to-date.
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Warfley

  • Hero Member
  • *****
  • Posts: 2050
Re: Synapse TCP/IP client and server(Second Edition)
« Reply #19 on: July 09, 2025, 10:37:31 pm »
How can I fix this?
Well with this great amount of information you gave us on the code you run... Either your server crashed or you closed the socket without a proper shutdown. Either way, your server killed the connection.

rca

  • Full Member
  • ***
  • Posts: 124
Re: Synapse TCP/IP client and server(Second Edition)
« Reply #20 on: July 09, 2025, 10:46:14 pm »
How can I fix this?
Well with this great amount of information you gave us on the code you run... Either your server crashed or you closed the socket without a proper shutdown. Either way, your server killed the connection.

I downloaded the .zip file from the first post.

There is a server and a client, with the option to send messages or files.

I haven't modified the original code.

The error occurs after successfully sending a file from the server to the client once.

After that, you can no longer successfully send files.

 

TinyPortal © 2005-2018