Commit cec20ff712bc18d95ce4c8e080d4efade082e4e7
1 parent
e162af43
Exists in
master
and in
3 other branches
Remodelando poll de sockets
Showing
4 changed files
with
13 additions
and
5 deletions
Show diff stats
connect.c
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | |
78 | 78 | |
79 | 79 | //static void net_connected(H3270 *hSession) |
80 | -static void net_connected(H3270 *hSession, LIB3270_IO_FLAG flag, void *dunno) | |
80 | +static void net_connected(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno) | |
81 | 81 | { |
82 | 82 | int err; |
83 | 83 | socklen_t len = sizeof(err); | ... | ... |
iocalls.c
... | ... | @@ -281,6 +281,14 @@ static void internal_remove_poll(void *id) |
281 | 281 | inputs_changed = True; |
282 | 282 | } |
283 | 283 | |
284 | +LIB3270_EXPORT void lib3270_remove_poll(void *id) { | |
285 | + remove_poll(id); | |
286 | +} | |
287 | + | |
288 | +LIB3270_EXPORT void * lib3270_add_poll_fd(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*call)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata ) { | |
289 | + return add_poll(session,fd,flag,call,userdata); | |
290 | +} | |
291 | + | |
284 | 292 | /* Event dispatcher. */ |
285 | 293 | static int internal_event_dispatcher(H3270 *hSession, int block) |
286 | 294 | { | ... | ... |
telnet.c
... | ... | @@ -988,7 +988,7 @@ LIB3270_EXPORT void lib3270_data_recv(H3270 *hSession, size_t nr, const unsigned |
988 | 988 | * @param hSession Session handle |
989 | 989 | * |
990 | 990 | */ |
991 | -void net_input(H3270 *hSession, LIB3270_IO_FLAG flag, void *dunno) | |
991 | +void net_input(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno) | |
992 | 992 | { |
993 | 993 | // register unsigned char * cp; |
994 | 994 | int nr; |
... | ... | @@ -1950,7 +1950,7 @@ process_eor(H3270 *hSession) |
1950 | 1950 | * net_exception |
1951 | 1951 | * Called when there is an exceptional condition on the socket. |
1952 | 1952 | */ |
1953 | -void net_exception(H3270 *session, LIB3270_IO_FLAG flag, void *dunno) | |
1953 | +void net_exception(H3270 *session, int fd, LIB3270_IO_FLAG flag, void *dunno) | |
1954 | 1954 | { |
1955 | 1955 | CHECK_SESSION_HANDLE(session); |
1956 | 1956 | ... | ... |
telnetc.h
... | ... | @@ -34,8 +34,8 @@ LIB3270_INTERNAL void net_add_eor(unsigned char *buf, int len); |
34 | 34 | LIB3270_INTERNAL void net_break(H3270 *hSession); |
35 | 35 | LIB3270_INTERNAL int net_connect(H3270 *session, const char *, char *, Boolean, Boolean *, Boolean *); |
36 | 36 | LIB3270_INTERNAL void net_disconnect(H3270 *session); |
37 | -LIB3270_INTERNAL void net_exception(H3270 *session, LIB3270_IO_FLAG flag, void *dunno); | |
38 | -LIB3270_INTERNAL void net_input(H3270 *session, LIB3270_IO_FLAG flag, void *dunno); | |
37 | +LIB3270_INTERNAL void net_exception(H3270 *session, int fd, LIB3270_IO_FLAG flag, void *dunno); | |
38 | +LIB3270_INTERNAL void net_input(H3270 *session, int fd, LIB3270_IO_FLAG flag, void *dunno); | |
39 | 39 | LIB3270_INTERNAL void net_interrupt(H3270 *hSession); |
40 | 40 | LIB3270_INTERNAL void net_output(H3270 *hSession); |
41 | 41 | LIB3270_INTERNAL void net_sendc(H3270 *hSession, char c); | ... | ... |