From nobody Wed Dec 15 10:51:42 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9AA7918E3D1A for ; Wed, 15 Dec 2021 10:51:50 +0000 (UTC) (envelope-from SRS0=wFgk=RA=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4JDX9y3QPbz4lc8 for ; Wed, 15 Dec 2021 10:51:50 +0000 (UTC) (envelope-from SRS0=wFgk=RA=klop.ws=ronald-lists@realworks.nl) Date: Wed, 15 Dec 2021 11:51:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1639565503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xhVGgXxMMUkPo4RX+1ih0K4bumUxVTIhdzhSrjNl5Gg=; b=tfdp7T7FJw+Q2ikqacGVH8YgSQnjkhT2Gr5levufxdbs9WMZUlu409CWG6CiXfXiNpI+2X yYCB2FRQXC/6QuBgtRgeQogA25E8iL+J4HrBQ2HEnE80m0zUUmG/YHrWZvsVk5ZzSWlRqf IVAUu1IkAAy8B41EvvEI1USVYmBr52+tblBl+Ia2MgQUbsdeTGSGjxwoSQ+FR8yzbP5dvz ngDpLEBsL0ATeal5VJyWuBFJeoV9qnBECPxaDnya0mJ6dfI4pTm9Q2yPOpnhxkbKW8baed 4ZpvRwxfnVAuhDgzWhOKsq/ry4Fr5Gku/mxV1Ji18jUENdTxSoNRu+HIHeO2BA== To: Piper H Cc: freebsd-current@freebsd.org Message-ID: <1412287950.345.1639565502579@localhost> In-Reply-To: References: Subject: Re: question on socket server List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_344_414513860.1639565502522" X-Mailer: Realworks (588.193.3eeb293) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4JDX9y3QPbz4lc8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: ronald-lists@klop.ws From: Ronald Klop via freebsd-current X-Original-From: Ronald Klop X-ThisMailContainsUnwantedMimeParts: Y ------=_Part_344_414513860.1639565502522 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 more information. So it depends a bit on the type of socket you created. Regards and happy hacking, Ronald. Van: Piper H Datum: woensdag, 15 december 2021 07:52 Aan: freebsd-current@freebsd.org Onderwerp: question on socket server > > Hello > > I have little knowledge about socket programming. > I have a question that, if I have made a socket server, listening on a > port. The server prints data to the socket, but there is never a client > connection to the port, and the data is never consumed. What will happen to > the server then? will the OS kernel be flushed by junk bytes? > > Thanks for your help. > Piper > > > ------=_Part_344_414513860.1639565502522--