Re: question on socket server

2021-12-15 Thread Ronald Klop via freebsd-current
Hi, Your program first waits for the first client to connect. So nothing is written anywhere. You can check by running "nc -v localhost " in another terminal. After the first client disconnects it keeps looping in the while and the print will return 0 which means failure. Something like th

Re: question on socket server

2021-12-15 Thread Ronald Klop via freebsd-current
Hi, Just try it! I think you will get an error that you are writing to a not-connected socket. From "man 2 write": " [EPIPE]An attempt is made to write to a socket of type SOCK_STREAM that is not connected to a peer socket." See also "man 2 send" and "man 2 socket" for a lot