|
From: James T. <ja...@fl...> - 2023-06-13 09:11:08
|
> On 12 Jun 2023, at 10:32, www2 <ww...@wo...> wrote: > > what current understand is that with the generic protocol is that the > command: > fgfs --generic=socket,in,5,127.0.0.3,1234,tcp,abc-protocol > act as a server that reseve data and the command > fgfs --generic=socket,out,5,127.0.0.3,1234,tcp,abc-protocol > act as a client that send only send. > (disclaimer i need to test this for id this is correct or this is revert > what i say) Correct, but for 12+ years you can also pass —generic=socket,bi,5,127.0.0.1,1234,tcp,abc-protocol and it will both read and write. Caveat: in ‘bi’ mode, the socket works in server mode, same as ‘in’ mode; you need to connect to it from your other side. But once you connect it will send you output data as normal. Ideally we would have some way to say ‘bi, but a client’ vs ‘bi, but a server’ but currently not possible. As ever, you should confirm this by reading the source code (eg, sg_socket.cxx and Network/generic.cxx) which are well commented. (Which is what I just did) Then you can document it for the next person :) Kind regards, James |