Commit da0f3311 authored by Oleg Zhurakivskyy's avatar Oleg Zhurakivskyy Committed by Jukka Rissanen
Browse files

samples: sockets: Don't open the socket if the test protocol is enabled



In order to be able to run the sanity check, don't open the socket
if the test protocol is enabled.

Also add a debug print at the recv().

This commit will be dropped:

- As soon as the sanity check site accomodates
- As soon as the integration is complete

Signed-off-by: default avatarOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
parent c7c24956
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ int main(void)
	struct sockaddr_in bind_addr;
	static int counter;

	if (IS_ENABLED(CONFIG_NET_TEST_PROTOCOL)) {
		exit(1);
	}

	serv = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

	if (serv < 0) {
@@ -80,6 +84,10 @@ int main(void)
				break;
			}

			if (IS_ENABLED(CONFIG_NET_TCP2)) {
				printf("recv: %d byte(s)\n", len);
			}

			p = buf;
			do {
				out_len = send(client, p, len, 0);