Solved

setsockopt: Type Of Service - How?

Posted on 1998-10-29
7
588 Views
Last Modified: 2013-11-20
I am trying to set the Type of Service socket options in a Visual C++ 5.0 (MFC) program. I am utilizing WinNT 4.0, winsock 1.1 and the CSocket class. I am particularly interested in setting the Precedence of the message. Can this be done? Can this be done with winsock 2? Thanks.
0
Comment
Question by:j99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 1

Expert Comment

by:sudhirbrat
ID: 1323984
In the function CSocket::Send( const void* lpBuf, int nBufLen, int nFlags = 0 );, u can use a flag MSG_OOB(Send out-of-band data ). But it works only for stream sockets. This option is generally used to send urgent data.
                            or
In the SetSockOpt() function u can Disable the Nagle algorithm for send with flag TCP_NODELAY. This will increase the performance, but has negative impact on network performance.


0
 

Author Comment

by:j99
ID: 1323985
Thank you for your interest in this question. I realize now that I should have been more specific. I'm specifically curious whether or not this works:

setsockopt(aSocket, IPPROTO_IP, IP_TOS,
           (const char FAR *)&tos, len);

where you are setting the precedence level. The sources I've looked at are consistent in saying that WinSock 1.1 does not provide access to the TOS field in the IP header; however, it's not clear whether or not WinSock 2.0 will really let you set this or not.
0
 

Accepted Solution

by:
zingo earned 220 total points
ID: 1323986
Yes, this can be done in WinSock 2 but not in 1.1. You are quite right. Was that worth 220 points?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:j99
ID: 1323987
I've looked high and low for documentation on this question. The documentation that I encountered "seems to indicate," as you suggest, that one may set this value using WinSock 2 and not 1.1. Of particular concern is whether or not Microsoft's specific implementation will allow this. Since much of the existing software at this shop is dependent on WinSock 1.1 calls, changing to WinSock 2 is highly problematic. Given all that, I'm happy to pay well for hard knowledge and experience with this question (which I'm assuming you have) before I go shooting my mouth off to management, customers, etc. Thank you for your interest in this question.
0
 

Expert Comment

by:zingo
ID: 1323988
Hmm, since you said you were going to shout at the management, I thought that I should look into it in more detail. And guess what I found? In winsock.h for WinSock 1.1, there is a definition "#define IP_TOS              8           /* set/get IP Type Of Service       */".
But there is no documentation on how to use it, so I assume that 0 is low prio and 7 is high. Feel free to try it out. I cant see why they havent documented this, but one reason could be that it is not implemented yet. So if I were you, I would verify it using an Ethernet analyzer. I hope you haven't done any shouting yet.

0
 

Author Comment

by:j99
ID: 1323989
Yep, utilizing IP_TOS does not work in 1.1. But does it work in WinSock 2?
0
 

Expert Comment

by:zingo
ID: 1323990
Tricky question. I have not used it myself, but I have been told it should work in version 2. My source on this is involved in IP telephony development, so I really hope that he knows what he is talking about.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question