sctplab / sctp-refimpl

Automatically exported from code.google.com/p/sctp-refimpl
BSD 2-Clause "Simplified" License
8 stars 2 forks source link

How connect to server in self process? #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have one app (game for example) with 3 working modes:
client
server
server with connected client (singleplayer)

first two works, but i cant connect to socket created in my process earlier

======
listening on :::55298.

SCTP: add HMAC id 1 to list
SCTP: added chunk 193 (0xc1) to Auth list
SCTP: added chunk 128 (0x80) to Auth list
Waiting for connections on port 55298
Bind called port: 55298
Addr: IPv6 address: 0:0:0:0:0:0:0:0:port:55298 scope:0
Main hash to bind at head:0x7f2fc0022190, bound port:55298 - in tcp_pool=0

SCTP: add HMAC id 1 to list
SCTP: added chunk 193 (0xc1) to Auth list
SCTP: added chunk 128 (0x80) to Auth list

Main hash to bind at head:0x7f2f94022a50, bound port:65095 - in tcp_pool=0
Allocate an association for peer:IPv6 address: 0:0:0:0:0:0:0:1:port:55298 
scope:0
Port:55298
Adding an address (from:1) to the peer: IPv6 address: 
0:0:0:0:0:0:0:1:port:55298 scope:0
Association 0x7f2f94027630 now allocated
Sending INIT
Sending INIT - calls lowlevel_output
Select source addr for:IPv6 address: 0:0:0:0:0:0:0:1:port:55298 scope:0
ifn from route:(nil) ifn_index:1
ifn_index:1 name:lo is emit interface
Is destination preferred:IPv6 address: 0:0:0:0:0:0:0:1:port:0 scope:0
src_loop:1 src_priv:0 src_glob:0
dest_loop:1 dest_priv:0 dest_glob:0
YES
Found 1 preferred source addresses for intf:lo
cur_addr_num:0
Is destination preferred:IPv6 address: 0:0:0:0:0:0:0:1:port:0 scope:0
src_loop:1 src_priv:0 src_glob:0
dest_loop:1 dest_priv:0 dest_glob:0
YES
Calling ipv6 output routine from low level
src: IPv6 address: 0:0:0:0:0:0:0:1:port:65095 scope:0
dst: IPv6 address: 0:0:0:0:0:0:0:1:port:55298 scope:0
return from send is 0
lowlevel_output - 0
recv_function_udp6: Received 236 bytes. - calling sctp_common_input_processing 
with off=12
stcb:(nil) inp:(nil)
stcb is (nil)

recv_function_udp6: Received 16 bytes. - calling sctp_common_input_processing 
with off=12
Ok, Common input processing called, m:0x7f2f900009d0 iphlen:0 offset:12 
length:16 stcb:0x7f2f94027630
stcb:0x7f2f94027630 state:2
sctp_process_control: iphlen=0, offset=12, length=16 stcb:0x7f2f94027630
sctp_process_control: processing a chunk type=6, len=4
SCTP_ABORT, stcb 0x7f2f94027630
sctp_handle_abort: handling ABORT
sctp_handle_abort: finished
Notification of length 24 received.

Association change SCTP_CANT_STR_ASSOC, streams (in/out) = (0/10), ABORT = 0x06 
0x00 0x00 0x04.
Timer type 16 goes off
Timer now complete (type 0)
Unified Inventory. inventory size: 225
Send called addr:(nil) send length 27
usrsctp_sendv: No such file or directory
======

i found some magic about creating and binding two udp sockets and passing them 
to usrsctp_socket
https://code.google.com/p/sctp-refimpl/source/browse/trunk/KERN/usrsctp/programs
/ekr_loop.c#352
but it seems overly complicated

Original issue reported on code.google.com by pro...@gmail.com on 14 Jul 2015 at 1:02