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_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
Compressed a little the POLL flags. 47b5dce395694c18c973e3ce6ba9a71c690a41bc Catalin(ux) M. BOIE 2009-08-25 18:16:16
Store also local address for incoming connections. 0548ce6434185cdd36e110c61315b4cb21849666 Catalin(ux) M. BOIE 2009-08-25 18:15:46
Added possibility to shutdown blackhole_s server by typing 'quit'. 5fd60900809e1a2d7554aa7fa93ce83b29214de0 Catalin(ux) M. BOIE 2009-08-25 17:54:27
Cosmetic changes. 7099dd49a270b9f4ecc0cb2e55254bef671202e5 Catalin(ux) M. BOIE 2009-08-25 17:54:15
Improved status output. 1ff597059bbb208b56ad18bf8324fae5b63950a2 Catalin(ux) M. BOIE 2009-08-25 17:53:44
Conn_type_* becomes CONN_TYPE_*. b284a20cc5430042cc662edc4d121c7f18cb3569 Catalin(ux) M. BOIE 2009-08-25 17:52:51
Improved status logging. 54fea00d8f16127244fd15b209c24f606adb20b3 Catalin(ux) M. BOIE 2009-08-25 17:33:14
Added Conn_strcasestr for case insensitive search in buffer. ca14b37b2a1f23887ad12fed729a3dd0ff253443 Catalin(ux) M. BOIE 2009-08-24 17:18:24
Improved ntime example. b63de9b82ffab1c0d759571a40f1d72f9b8df927 Catalin(ux) M. BOIE 2009-08-24 17:09:21
Removed unused includes. 8af81a4c311caa7d738000a5208d01d7620d1040 Catalin(ux) M. BOIE 2009-08-21 18:57:33
Improved blackhole example. 2fd7ff181a412f4ba060b0e89b97acdf89a8fb88 Catalin(ux) M. BOIE 2009-08-21 18:03:22
Fixed connections to outside. Still, it is a little mess there. 417ccd4a48508a810377676658d51c5103168472 Catalin(ux) M. BOIE 2009-08-21 17:42:37
addr and bind_addr are not pointers! Corrected them. e1deeb765500ee079802c2cd6543f9c9496d8f9b Catalin(ux) M. BOIE 2009-08-21 16:49:24
Exported _alloc and _commit functions. 9a3159e89eff020cfb75b9eec49a45a637a6da57 Catalin(ux) M. BOIE 2009-08-21 16:39:27
Added blackhole example. 8a7ac49b018ad65ba386f8a50725745127b4cbd2 Catalin(ux) M. BOIE 2009-08-21 15:54:55
TODO in/out. fdcfbf9e18ed5fbe0135b9aa702e09432fa71e93 Catalin(ux) M. BOIE 2009-08-21 15:53:05
First chunk of generic socket handling. b9a488ba615c4322b5d116a29919f11fd476b200 Catalin(ux) M. BOIE 2009-08-21 15:50:45
Added ntime example (returns CLOCK_REALTIME as fast as it can). e2fa318caf3e9aea09a853ab2b4af4b5a2cc8261 Catalin(ux) M. BOIE 2009-08-20 15:41:20
Commit 4ca191771c5c119e9755a5af3158fabe43ddf5f2 - Added Conn_stop to eleganly stop Conn system.
Signed-off-by: Catalin(ux) M. BOIE <catab@embedromix.ro>
Author: Catalin(ux) M. BOIE
Author date (UTC): 2009-08-25 18:30
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2009-09-02 15:42
Parent(s): a1cbc5c612d82e6d1341524c67fe249648c81806
Signing key:
Tree: dbe36040bccca2b0a8173943295f2ff2dab9f834
File Lines added Lines deleted
Conn.c 3 0
Conn_engine_core.c 9 0
Conn_engine_core.h 6 3
examples/blackhole_s.c 1 1
File Conn.c changed (mode: 100644) (index a8e3c53..db30510)
... ... int Conn_poll(const int timeout)
1286 1286 timeout2 = timeout; timeout2 = timeout;
1287 1287
1288 1288 loop: loop:
1289 if (Conn_must_stop == 1)
1290 return 0;
1291
1289 1292 if (Conn_no == 0) if (Conn_no == 0)
1290 1293 return 0; return 0;
1291 1294
File Conn_engine_core.c changed (mode: 100644) (index 3bb0b98..f7e4747)
... ... struct Conn *Conns = NULL;
48 48 unsigned int Conn_inited = 0; unsigned int Conn_inited = 0;
49 49 unsigned int Conn_allocated = 0; unsigned int Conn_allocated = 0;
50 50 unsigned long long Conn_id = 1; unsigned long long Conn_id = 1;
51 unsigned int Conn_must_stop = 0;
51 52
52 53 char Conn_error[512]; char Conn_error[512];
53 54
 
... ... void Conn_close(struct Conn *C)
932 933 C->flags |= CONN_FLAGS_CLOSE_AFTER_SEND; C->flags |= CONN_FLAGS_CLOSE_AFTER_SEND;
933 934 } }
934 935
936 /*
937 * Instructs Conn to stop
938 */
939 void Conn_stop(void)
940 {
941 Conn_must_stop = 1;
942 }
943
935 944 /* /*
936 945 * Set some internal parameters * Set some internal parameters
937 946 */ */
File Conn_engine_core.h changed (mode: 100644) (index c7cc43f..63d17ac)
... ... extern unsigned short Conn_level;
243 243 extern unsigned int Conn_accept_is_allowed; extern unsigned int Conn_accept_is_allowed;
244 244 extern unsigned int Conn_accept_is_allowed_last; extern unsigned int Conn_accept_is_allowed_last;
245 245
246 extern struct Conn *Conns;
247 extern unsigned int Conn_inited;
248 extern unsigned int Conn_allocated;
246 extern struct Conn *Conns;
247 extern unsigned int Conn_inited;
248 extern unsigned int Conn_allocated;
249 249 extern unsigned long long Conn_id; extern unsigned long long Conn_id;
250 extern unsigned int Conn_must_stop;
250 251
251 252 extern char Conn_error[512]; extern char Conn_error[512];
252 253
 
... ... extern int Conn_addr_family(const char *addr);
313 314
314 315 extern void Conn_error_raise(struct Conn *C, const int err); extern void Conn_error_raise(struct Conn *C, const int err);
315 316
317 extern void Conn_stop(void);
318
316 319 /* queue stuff */ /* queue stuff */
317 320 extern void Conn_queue_init(struct Conn_queue *q); extern void Conn_queue_init(struct Conn_queue *q);
318 321 extern int Conn_queue_add(struct Conn_queue *q, extern int Conn_queue_add(struct Conn_queue *q,
File examples/blackhole_s.c changed (mode: 100644) (index f583013..d345d4f)
... ... static void s_data(struct Conn *C)
26 26 { {
27 27 /* You can connect to server and send 'quit' command */ /* You can connect to server and send 'quit' command */
28 28 if (Conn_strcasestr(C, "quit")) if (Conn_strcasestr(C, "quit"))
29 Conn_close(C);
29 Conn_stop();
30 30
31 31 /* throw away all data */ /* throw away all data */
32 32 bytes += Conn_qlen(C); bytes += Conn_qlen(C);
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