SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] Multi-streams


Chronological Thread 
  • From: "Oon Heok Kee" <oonheokkee78 AT hotmail.com>
  • To: dreibh AT exp-math.uni-essen.de, discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] Multi-streams
  • Date: Fri Aug 30 14:17:00 2002
  • List-id: SCTP Discussions <discussion.sctp.de>

Hi,

I tried what you advised, and made a little bit of headway. There is a little bit of change to what's running on the client now, but server is still initialising with 1 in and 1 out stream.

I've put the entire chunk of code setting the parameters of struct sctp_initmsg and putting in the ext_setsockoption() just after ext_bind(), before ext_listen(), but it's still the same. Is there anything else that I can try?

Thanks a lot... :)



Oon, Heok Kee


----Original Message Follows----
From: Thomas Dreibholz
<dreibh AT exp-math.uni-essen.de>
To: "Oon Heok Kee"
<oonheokkee78 AT hotmail.com>,

discussion AT sctp.de
Subject: Re: [SCTP-Discussion] Multi-streams
Date: Fri, 30 Aug 2002 13:59:51 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Freitag, 30. August 2002 13:26 schrieb Oon Heok Kee:
> Hi,
>
> I'm trying to run my echo program on multi-stream.
>
> Based on the captures from Ethereal, the client is able to request for
> multiple in and out streams in the INIT chunk. But the INIT ACK chunk from
> the host is always requesting for only 1 in and 1 out. I tried putting the
> struct sctp_initmsg in the server program, but it didn't work either. How
> do I get the server program to respond with the requested number of streams
> by the client?

Have you used the SCTP_INITMSG socket option before calling accept() on the
server side? When accept() returns, the SCTP association is already
established with the current in/out streams settings. Therefore, setting
SCTP_INITMSG has no effect after accept(). Recommendation: Set SCTP_INITMSG
directly after binding the socket using ext_bind() or ext_bindx().


>
> From previous examples, I see that sendmsg() had only been sending the
> things stated in struct msghdr. Suppose I have a string "This is to be
> sent" to go from the client to the server and back. Do I just add the size
> of this string to the buffers and also "echoString = (char *)(cmsg + 2);",
> so that's it's sent together in msg?

User data and control structures are separated in the msghdr structure:
msg_iov for user data and msg_control for control structures. To send your
string, you have to specifiy it in msg_iov, not in the control part (cmsg
above)!
Example:
struct iovec iov[1];
struct msghdr msg;
...
echoString = This is to be sent";
iov[0].iov_base = echoString;
iov[0].iov_len = strlen(echoString); <- Length of string
msg.msg_iov = &iov;
msg.msg_iovlen = 1; <- One entry in iovec array!


Best regards
- --
=======================================================================
Dipl.-Inform. Thomas Dreibholz

University of Essen, Room ES210
Inst. for Experimental Mathematics Ellernstraße 29
Computer Networking Technology Group D-45326 Essen/Germany
- -----------------------------------------------------------------------
E-Mail:
dreibh AT exp-math.uni-essen.de
Homepage: http://www.exp-math.uni-essen.de/~dreibh
=======================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9b14632BbsHYPLWURAr2JAJ0WrecukxjgynZ57L+aayj2La1jYACeIx8B
gyPzNq506XZRBCIMel4V/GI=
=ptkl
-----END PGP SIGNATURE-----



Oon, Heok Kee

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com





Archive powered by MHonArc 2.6.19+.

Top of page