catalinux / Conn (public) (License: LGPLv2) (since 2016-03-01) (hash sha1)
Net library for easy building ipv4/ipv6 network daemons/clients
List of commits:
Subject Hash Author Date (UTC)
Added Conn_work_to_do to signal when we can exit. 492d960bf3e5b3718fe69ffc8ef30fbe344a805f Catalin(ux) M. BOIE 2009-08-31 20:50:56
Splited reporting of error types. 2d28a3be0ebb1f5e3f548d2523ac591af7dee3b9 Catalin(ux) M. BOIE 2009-08-31 20:08:54
Conn_commit will return error, so, do not call error callback. c97f8be6cfd55c32d78e62a30375d7c014dc0e0a Catalin(ux) M. BOIE 2009-08-31 20:08:17
Cosmetic changes. 54a9e723c3a958e69f491b55df83f96b6814af44 Catalin(ux) M. BOIE 2009-08-31 20:07:51
Raised default listen para to 4096 from 128. somaxconn still has prio. af39935492f39786879ea6ced9f7dfe929c4879d Catalin(ux) M. BOIE 2009-08-31 19:56:36
Store in time_open the accept timestamp so Conn_lifetime will work on srv side. 0522d638872644d7bd6490027a7ae99b1fb4b16f Catalin(ux) M. BOIE 2009-08-31 19:55:44
Improved blackhole examples. 128f393aba2b07c4aa0e41d962a8239dffc3cc10 Catalin(ux) M. BOIE 2009-08-31 17:41:30
More entries to .gitignore. e1d71bcf46a9b61a4aa4e17b857ff9035d7fb6c7 Catalin(ux) M. BOIE 2009-08-31 17:39:45
Tweaked a little the debug level for some messages. 1a27a1acf2ede62fb02b074f232badeb847bfcb8 Catalin(ux) M. BOIE 2009-08-31 17:39:21
Added Conn_lifetime (returns the time in ms between connected state and now). 4e3f1aaabc21d4cbdac26e42612ebd0298c8d86e Catalin(ux) M. BOIE 2009-08-31 17:22:37
Added Conn_sys that logs some system variables related to network perf. af960f317b8ca9a8f78fe44e80ddbdb6a9483e6f Catalin(ux) M. BOIE 2009-08-31 16:36:00
Better output flags. d57a98c2b158aeb30530c2e5188977a40336a360 Catalin(ux) M. BOIE 2009-08-25 20:37:55
Improved examples. 75439293c1d067327e606d72ec6290b43110bf24 Catalin(ux) M. BOIE 2009-08-25 20:37:29
Removed line1.c because duplicates code. 1119059afacde8d0b7b7dab77850dd6b71684190 Catalin(ux) M. BOIE 2009-08-25 20:11:52
Removed *.run becasue we have a generic run script. 007083cd9d1abefe4dd73e65c9026a2607fbcd4e Catalin(ux) M. BOIE 2009-08-25 20:09:00
Removed bind_s example because blackhole_s will take place. b9b06d98f00413b5a5df9d7bc9b3bd05b5536f28 Catalin(ux) M. BOIE 2009-08-25 20:07:38
Added Conn_set_address helper. 1b6e7e8a294ac88aa966e4e43bb77a4fdff0ca5a Catalin(ux) M. BOIE 2009-08-25 19:21:00
Fixed storing of local address (do not overwrite remote address). d431edba6699d1363e4d616aa6f96588272188b0 Catalin(ux) M. BOIE 2009-08-25 18:37:55
Added Conn_stop to eleganly stop Conn system. 4ca191771c5c119e9755a5af3158fabe43ddf5f2 Catalin(ux) M. BOIE 2009-08-25 18:30:32
Replaced Conn_protocol with Conn_get_socket_protocol. a1cbc5c612d82e6d1341524c67fe249648c81806 Catalin(ux) M. BOIE 2009-08-25 18:16:45
Commit 492d960bf3e5b3718fe69ffc8ef30fbe344a805f - Added Conn_work_to_do to signal when we can exit.
Signed-off-by: Catalin(ux) M. BOIE <catab@embedromix.ro>
Author: Catalin(ux) M. BOIE
Author date (UTC): 2009-08-31 20:50
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2009-09-02 15:42
Parent(s): 2d28a3be0ebb1f5e3f548d2523ac591af7dee3b9
Signing key:
Tree: 83aa7fc8bec1f114cd65a46d809f5dfc8c260754
File Lines added Lines deleted
Conn.c 13 3
Conn_engine_core.c 1 0
Conn_engine_core.h 1 0
File Conn.c changed (mode: 100644) (index 304e689..110c6e5)
... ... int Conn_init(const unsigned int max)
170 170 Conn_max = max; Conn_max = max;
171 171
172 172 Conn_no = 0; Conn_no = 0;
173 Conn_work_to_do = 0;
173 174 Conn_total = 0; Conn_total = 0;
174 175 Conn_max_reached = 0; Conn_max_reached = 0;
175 176 gettimeofday(&Conn_now, NULL); gettimeofday(&Conn_now, NULL);
 
... ... static void Conn_free_intern(struct Conn *C)
321 322
322 323 /* Decrement the number of busy connections */ /* Decrement the number of busy connections */
323 324 Conn_no--; Conn_no--;
325 Conn_work_to_do--;
324 326 } }
325 327 } }
326 328
 
... ... struct Conn *Conn_alloc(void)
446 448 C->id = Conn_id++; C->id = Conn_id++;
447 449
448 450 Conn_no++; Conn_no++;
451 /* Conn_work_to_do will not be incremented here, only in commit! */
449 452
450 453 Log(10, "\tFound free slot=%u, id=%llu. Now Conn_no=%d\n", Log(10, "\tFound free slot=%u, id=%llu. Now Conn_no=%d\n",
451 454 C->slot, C->id, Conn_no); C->slot, C->id, Conn_no);
 
... ... int Conn_commit(struct Conn *C)
682 685
683 686 C->state = first_state; C->state = first_state;
684 687
688 Conn_work_to_do++;
689
685 690 return 0; return 0;
686 691
687 692 out_free_fd: out_free_fd:
 
... ... static void Conn_accept(struct Conn *C)
851 856 else if (Conn_accept_cb != NULL) else if (Conn_accept_cb != NULL)
852 857 Conn_accept_cb(X); Conn_accept_cb(X);
853 858
859 Conn_work_to_do++;
860
854 861 Conn_total++; Conn_total++;
855 862 } }
856 863
 
... ... int Conn_poll(const int timeout)
1311 1318 int timeout2; int timeout2;
1312 1319 unsigned int i, last; unsigned int i, last;
1313 1320
1314 Log(11, "%s: timeout=%d Conn_no=%d)\n",
1315 __FUNCTION__, timeout, Conn_no);
1321 Log(9, "%s: timeout=%d Conn_no=%d, Conn_work_to_do=%u)\n",
1322 __FUNCTION__, timeout, Conn_no, Conn_work_to_do);
1316 1323
1317 1324 if (timeout == -1) if (timeout == -1)
1318 1325 timeout2 = 1000; timeout2 = 1000;
 
... ... int Conn_poll(const int timeout)
1323 1330 if (Conn_must_stop == 1) if (Conn_must_stop == 1)
1324 1331 return 0; return 0;
1325 1332
1326 if (Conn_no == 0)
1333 if (Conn_work_to_do == 0) {
1334 Log(9, "%s: work_to_do is 0, so return 0!\n",
1335 __FUNCTION__);
1327 1336 return 0; return 0;
1337 }
1328 1338
1329 1339 if (Conn_pending > 0) if (Conn_pending > 0)
1330 1340 Conn_trytoconnect(); Conn_trytoconnect();
File Conn_engine_core.c changed (mode: 100644) (index c05d5a7..34e68f8)
... ... unsigned int Conn_max_send = 32 * 1024;
35 35 unsigned int Conn_max_recv = 32 * 1024; unsigned int Conn_max_recv = 32 * 1024;
36 36
37 37 unsigned int Conn_no = 0; unsigned int Conn_no = 0;
38 unsigned int Conn_work_to_do = 0;
38 39 unsigned int Conn_max = 0; unsigned int Conn_max = 0;
39 40 unsigned long Conn_total = 0; unsigned long Conn_total = 0;
40 41 unsigned int Conn_start = 0; unsigned int Conn_start = 0;
File Conn_engine_core.h changed (mode: 100644) (index da7262d..bf5b921)
... ... extern unsigned int Conn_default_obuf;
232 232 extern unsigned int Conn_max_ibuf; extern unsigned int Conn_max_ibuf;
233 233 extern unsigned int Conn_max_obuf; extern unsigned int Conn_max_obuf;
234 234 extern unsigned int Conn_no; extern unsigned int Conn_no;
235 extern unsigned int Conn_work_to_do;
235 236 extern unsigned int Conn_max; extern unsigned int Conn_max;
236 237 extern unsigned long Conn_total; extern unsigned long Conn_total;
237 238 extern unsigned int Conn_start; extern unsigned int Conn_start;
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/Conn

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/Conn

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/Conn

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main