Click here to Skip to main content
15,920,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: another quick question.. Pin
John M. Drescher26-Jun-03 8:52
John M. Drescher26-Jun-03 8:52 
GeneralRe: another quick question.. Pin
RobJones26-Jun-03 9:14
RobJones26-Jun-03 9:14 
GeneralRe: another quick question.. Pin
CyberDen26-Jun-03 9:36
CyberDen26-Jun-03 9:36 
GeneralOwn client/server and 10053 problem Pin
justin22326-Jun-03 6:31
justin22326-Jun-03 6:31 
GeneralRe: Own client/server and 10053 problem Pin
keegan26-Jun-03 6:35
keegan26-Jun-03 6:35 
GeneralRe: Own client/server and 10053 problem Pin
justin22326-Jun-03 7:21
justin22326-Jun-03 7:21 
GeneralRe: Own client/server and 10053 problem Pin
justin22326-Jun-03 7:27
justin22326-Jun-03 7:27 
GeneralRe: Own client/server and 10053 problem Pin
RobJones26-Jun-03 10:56
RobJones26-Jun-03 10:56 
The client that connects to you needs to set their own linger options before they connect to you. Same with your server app (you should set linger before you bind the socket)..

I'm not sure if you can set that option after the socket has already been connected or after it accepts a connection..

One other thing (and im not 100% sure) but I dont think you need to call shutdown on a socket when it doesn't linger.. I think you can close the socket right away to free up the socket resoruces..

linger linger;
linger.l_onoff = TRUE;
linger.l_linger = 0;			
setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof(struct linger));

if(bind(server,(sockaddr*)&local,sizeof(local))!=0)
{
	if(server != INVALID_SOCKET)
		closesocket(server);

	MessageBox("Error Binding socket", "Socket Error", MB_OK);

}
else
{
	if(listen(server,10) != 0)
	{
		if(server != INVALID_SOCKET)
			closesocket(server);

etc.....
}


Hope this gets you pointed in the right direction..

Rob

Whoever said nothing's impossible never tried slamming a revolving door!
GeneralVersion number Pin
Anonymous26-Jun-03 5:35
Anonymous26-Jun-03 5:35 
GeneralRe: Version number Pin
basementman26-Jun-03 6:33
basementman26-Jun-03 6:33 
GeneralI need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
johnstonsk26-Jun-03 5:21
johnstonsk26-Jun-03 5:21 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
Ryan Binns26-Jun-03 5:29
Ryan Binns26-Jun-03 5:29 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
johnstonsk26-Jun-03 5:42
johnstonsk26-Jun-03 5:42 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
Ian Darling26-Jun-03 6:22
Ian Darling26-Jun-03 6:22 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
David Crow26-Jun-03 7:20
David Crow26-Jun-03 7:20 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
Ryan Binns26-Jun-03 14:55
Ryan Binns26-Jun-03 14:55 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
johnstonsk27-Jun-03 3:56
johnstonsk27-Jun-03 3:56 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
Ryan Binns27-Jun-03 3:59
Ryan Binns27-Jun-03 3:59 
GeneralRe: I need AIR & I'm pulling my hair out over Random doubles within a specified range Pin
Dominik Reichl26-Jun-03 7:50
Dominik Reichl26-Jun-03 7:50 
GeneralStandard Error and Warning Images Pin
Steve Thresher26-Jun-03 3:31
Steve Thresher26-Jun-03 3:31 
GeneralRe: Standard Error and Warning Images Pin
basementman26-Jun-03 3:54
basementman26-Jun-03 3:54 
GeneralRe: Standard Error and Warning Images Pin
Steve Thresher26-Jun-03 4:35
Steve Thresher26-Jun-03 4:35 
GeneralRe: Standard Error and Warning Images Pin
Ryan Binns26-Jun-03 5:19
Ryan Binns26-Jun-03 5:19 
Generalusing a vector with CComboBox::AddString() in MFC Pin
keegan26-Jun-03 2:52
keegan26-Jun-03 2:52 
GeneralRe: using a vector with CComboBox::AddString() in MFC Pin
Maximilien26-Jun-03 3:18
Maximilien26-Jun-03 3:18 

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.