From a43dc3fcac6d6af0082edc73b0b148ca2c504c3a Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 27 Nov 2024 12:23:26 +0100 Subject: more --- bin/binding | Bin 0 -> 16272 bytes bin/client | Bin 0 -> 16888 bytes bin/client-DGRAM | Bin 0 -> 16808 bytes bin/connecting | Bin 0 -> 16176 bytes bin/dumbclient | Bin 0 -> 16328 bytes bin/helloworld | Bin 0 -> 16336 bytes bin/listen | Bin 0 -> 16880 bytes bin/listen-DGRAM | Bin 0 -> 16712 bytes client.c | 6 +++--- polling.c | 25 +++++++++++++++++++++++++ test/binding-t | Bin 0 -> 30104 bytes test/client-DGRAM-t | Bin 0 -> 37512 bytes test/client-t | Bin 0 -> 38088 bytes test/connecting-t | Bin 0 -> 29880 bytes test/dumbclient-t | Bin 0 -> 31024 bytes test/helloworld-t | Bin 0 -> 31288 bytes test/listen-DGRAM-t | Bin 0 -> 37160 bytes test/listen-t | Bin 0 -> 38864 bytes 18 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 bin/binding create mode 100755 bin/client create mode 100755 bin/client-DGRAM create mode 100755 bin/connecting create mode 100755 bin/dumbclient create mode 100755 bin/helloworld create mode 100755 bin/listen create mode 100755 bin/listen-DGRAM create mode 100644 polling.c create mode 100755 test/binding-t create mode 100755 test/client-DGRAM-t create mode 100755 test/client-t create mode 100755 test/connecting-t create mode 100755 test/dumbclient-t create mode 100755 test/helloworld-t create mode 100755 test/listen-DGRAM-t create mode 100755 test/listen-t diff --git a/bin/binding b/bin/binding new file mode 100755 index 0000000..be7fffa Binary files /dev/null and b/bin/binding differ diff --git a/bin/client b/bin/client new file mode 100755 index 0000000..d734cd7 Binary files /dev/null and b/bin/client differ diff --git a/bin/client-DGRAM b/bin/client-DGRAM new file mode 100755 index 0000000..2e9e02a Binary files /dev/null and b/bin/client-DGRAM differ diff --git a/bin/connecting b/bin/connecting new file mode 100755 index 0000000..d38978f Binary files /dev/null and b/bin/connecting differ diff --git a/bin/dumbclient b/bin/dumbclient new file mode 100755 index 0000000..c3c3f3f Binary files /dev/null and b/bin/dumbclient differ diff --git a/bin/helloworld b/bin/helloworld new file mode 100755 index 0000000..25a4932 Binary files /dev/null and b/bin/helloworld differ diff --git a/bin/listen b/bin/listen new file mode 100755 index 0000000..0869f76 Binary files /dev/null and b/bin/listen differ diff --git a/bin/listen-DGRAM b/bin/listen-DGRAM new file mode 100755 index 0000000..d43ce2c Binary files /dev/null and b/bin/listen-DGRAM differ diff --git a/client.c b/client.c index eac217c..1a240a1 100644 --- a/client.c +++ b/client.c @@ -20,12 +20,12 @@ int sockfd = -1; size_t bytes_sent = 0; -void talk_to_server (int sockfd) { +void talk_to_server (int ttssockfd) { fprintf(stdout, "Waiting to connect...\n"); int rcv_ret; char buf_connected[11]; - rcv_ret = recv(sockfd, buf_connected, 11, 0); + rcv_ret = recv(ttssockfd, buf_connected, 11, 0); buf_connected[rcv_ret] = '\0'; fprintf(stdout, "%s", buf_connected); while (1) { @@ -38,7 +38,7 @@ void talk_to_server (int sockfd) { continue; } - bytes_sent = bytes_sent + send(sockfd, editbuffer, fgs_len, 0); + bytes_sent = bytes_sent + send(ttssockfd, editbuffer, fgs_len, 0); } } diff --git a/polling.c b/polling.c new file mode 100644 index 0000000..bce456e --- /dev/null +++ b/polling.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define __FAIL EXIT_FAILURE +#define BACKLOG 2 +#define __PORT "62000" +#define BUF_SZ_2 2048 + +int main () { + + + +} diff --git a/test/binding-t b/test/binding-t new file mode 100755 index 0000000..5352fec Binary files /dev/null and b/test/binding-t differ diff --git a/test/client-DGRAM-t b/test/client-DGRAM-t new file mode 100755 index 0000000..8329741 Binary files /dev/null and b/test/client-DGRAM-t differ diff --git a/test/client-t b/test/client-t new file mode 100755 index 0000000..7e519aa Binary files /dev/null and b/test/client-t differ diff --git a/test/connecting-t b/test/connecting-t new file mode 100755 index 0000000..e4628f7 Binary files /dev/null and b/test/connecting-t differ diff --git a/test/dumbclient-t b/test/dumbclient-t new file mode 100755 index 0000000..e320f44 Binary files /dev/null and b/test/dumbclient-t differ diff --git a/test/helloworld-t b/test/helloworld-t new file mode 100755 index 0000000..e2cfd3d Binary files /dev/null and b/test/helloworld-t differ diff --git a/test/listen-DGRAM-t b/test/listen-DGRAM-t new file mode 100755 index 0000000..d28e6c4 Binary files /dev/null and b/test/listen-DGRAM-t differ diff --git a/test/listen-t b/test/listen-t new file mode 100755 index 0000000..6bd5551 Binary files /dev/null and b/test/listen-t differ -- cgit v1.2.3