Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dialog box wizard Pin
Maximilien20-Apr-05 5:00
Maximilien20-Apr-05 5:00 
GeneralRe: Dialog box wizard Pin
benhed20-Apr-05 5:09
benhed20-Apr-05 5:09 
GeneralWinsock and MFC Pin
sweep12320-Apr-05 4:28
sweep12320-Apr-05 4:28 
GeneralRe: Winsock and MFC Pin
Manikandan20-Apr-05 5:37
Manikandan20-Apr-05 5:37 
GeneralRe: Winsock and MFC Pin
sweep12320-Apr-05 5:45
sweep12320-Apr-05 5:45 
GeneralRe: Winsock and MFC Pin
Manikandan20-Apr-05 5:51
Manikandan20-Apr-05 5:51 
GeneralRe: Winsock and MFC Pin
Tom Wright20-Apr-05 9:28
Tom Wright20-Apr-05 9:28 
GeneralLimit Bandwith using WinSock2 Pin
bigbby20-Apr-05 4:16
bigbby20-Apr-05 4:16 
Hi! I wanna implement a simple web client using winsock. It can connect to any kind of HTTP servers (such as Apahce on Linux, IIS,....etc).
I also hope I can limit the bandwidth for each connection. I check the document (MSDN) that WSAConnect() provide the parameter (LPQOS lpSQOS) which can specify some properties of QoS including Bandwidth limitation. I write my code as follows:

QOS clientQos;
FLOWSPEC flowspec_guaranteed = {13000,
1260,
13000,
QOS_NOT_SPECIFIED,
QOS_NOT_SPECIFIED,
SERVICETYPE_GUARANTEED,
340,
340};

void InitQos()
{
clientQos.SendingFlowspec = flowspec_guaranteed;
clientQos.ReceivingFlowspec = flowspec_guaranteed;
clientQos.ProviderSpecific.buf = NULL;
clientQos.ProviderSpecific.len = 0;
}

main()
{

SOCKET s;
........
WSADATA WSAData;
err = WSAStartup(MAKEWORD(2,2), &WSAData);
s =Socket(AF_INET, SOCK_STREAM, proto);
.............
WSASetLastError(0);
returnval = WSAConnect(s, (SOCKADDR *)&sin, sizeof(sin), NULL, NULL, &clientQos, NULL);
if (returnval == SOCKET_ERROR)
{
j=WSAGetLastError();
closesocket(s);
}
while(....)
{
Send(s,.....);
}
while(....)
{
Recv(s,.....);
}

closesocket(s);

}

However, My program still send and receive data as soon as possible with the server (Apache Server) and I didn't get any error at all. It seems there is no bandwidth limit at all. Is there something I miss? Or It actually doesn't work at all and I go in the wrong way? Thanks a lot!

GeneralRe: Limit Bandwith using WinSock2 Pin
cmk20-Apr-05 10:05
cmk20-Apr-05 10:05 
GeneralRegular DLL syntax question Pin
odiesback20-Apr-05 3:53
odiesback20-Apr-05 3:53 
GeneralRe: Regular DLL syntax question Pin
User 58385220-Apr-05 4:06
User 58385220-Apr-05 4:06 
GeneralRe: Regular DLL syntax question Pin
odiesback20-Apr-05 4:25
odiesback20-Apr-05 4:25 
GeneralRe: Regular DLL syntax question Pin
CatMan6120-Apr-05 11:26
CatMan6120-Apr-05 11:26 
GeneralAbout STN_CLICKED notification message Pin
coffeecoffee20-Apr-05 3:15
coffeecoffee20-Apr-05 3:15 
GeneralRe: About STN_CLICKED notification message Pin
James R. Twine20-Apr-05 7:54
James R. Twine20-Apr-05 7:54 
GeneralUnix Tutorials Pin
Neelesh K J Jain20-Apr-05 2:56
Neelesh K J Jain20-Apr-05 2:56 
GeneralRe: Unix Tutorials Pin
markkuk20-Apr-05 6:27
markkuk20-Apr-05 6:27 
Generalmfc filepath problem Pin
tordyvel20-Apr-05 2:47
tordyvel20-Apr-05 2:47 
GeneralRe: mfc filepath problem Pin
David Crow20-Apr-05 3:25
David Crow20-Apr-05 3:25 
GeneralRe: mfc filepath problem Pin
22491720-Apr-05 4:03
22491720-Apr-05 4:03 
GeneralCRecordset and text columns Pin
CatMan6120-Apr-05 2:19
CatMan6120-Apr-05 2:19 
GeneralRe: CRecordset and text columns Pin
22491720-Apr-05 6:32
22491720-Apr-05 6:32 
GeneralRe: CRecordset and text columns Pin
CatMan6120-Apr-05 11:18
CatMan6120-Apr-05 11:18 
GeneralRe: CRecordset and text columns Pin
CatMan6120-Apr-05 11:28
CatMan6120-Apr-05 11:28 
GeneralMap ListBox to CCheckListBox Pin
Yaron Abershitz20-Apr-05 2:04
Yaron Abershitz20-Apr-05 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.