diff options
Diffstat (limited to 'c/sock.h')
| -rw-r--r-- | c/sock.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -42,6 +42,12 @@ static unsigned char net_recv(unsigned char s, void *buf, unsigned char max) { _nr.op = 3; _nr.sock = s; _nr.buf = (unsigned char *)buf; _nr.len = max; return sys_net(&_nr); } +/* set the local (source) port - needed so UDP replies demux back to us */ +static unsigned char net_bind(unsigned char s, unsigned int port) { + _nr.op = 5; _nr.sock = s; + _nr.port_hi = (unsigned char)(port >> 8); _nr.port_lo = (unsigned char)port; + return sys_net(&_nr); +} static void net_close(unsigned char s) { _nr.op = 4; _nr.sock = s; sys_net(&_nr); } |
