Click here to Skip to main content
15,915,702 members
Home / Discussions / C#
   

C#

 
GeneralRe: data base Pin
Heath Stewart15-Dec-04 22:47
protectorHeath Stewart15-Dec-04 22:47 
GeneralDisable controls without highliting Pin
fracalifa15-Dec-04 21:21
fracalifa15-Dec-04 21:21 
GeneralRe: Disable controls without highliting Pin
Jay Shankar15-Dec-04 22:16
Jay Shankar15-Dec-04 22:16 
GeneralRe: Disable controls without highliting Pin
fracalifa15-Dec-04 22:48
fracalifa15-Dec-04 22:48 
GeneralRe: Disable controls without highliting Pin
Jay Shankar16-Dec-04 14:17
Jay Shankar16-Dec-04 14:17 
Generalpropagating datagrid changes in multiple tables Pin
Rashid_Mehmood15-Dec-04 20:31
Rashid_Mehmood15-Dec-04 20:31 
GeneralRe: propagating datagrid changes in multiple tables Pin
Heath Stewart15-Dec-04 22:41
protectorHeath Stewart15-Dec-04 22:41 
QuestionHow to disconnect remoting server properly? Pin
kosjanne15-Dec-04 20:28
kosjanne15-Dec-04 20:28 
My problem is that I can't restart my remoting server. This is how I
start the server:

m_ServerSinkProvider = new BinaryServerFormatterSinkProvider();
m_ServerSinkProvider.TypeFilterLevel = TypeFilterLevel.Full;
m_Props.Clear();
m_Props.Add("port", nPort);
m_Props.Add("typeFilterLevel", TypeFilterLevel.Full);
m_TcpChannel = new TcpChannel(m_Props, null, m_ServerSinkProvider);
ChannelServices.RegisterChannel(m_TcpChannel);
RemotingServices.Marshal(InstanceOfRemoteserverClass, "DataHandler");

This is what I do when I stop the server:

RemotingServices.Disconnect(InstanceOfRemoteserverClass);
ChannelServices.UnregisterChannel(m_TcpChannel);

When I try to start the server again, I do the start part again. When
I restart, I get an exception: only one usage of each socket address
(protocol/network address/port) is normally permitted. This is caused
by:
m_TcpChannel = new TcpChannel(m_Props, null, m_ServerSinkProvider);

This exception will occur only if my client has connected atleast
once.

The reason I need to create new TcpChannel every time server is
started is that the user can decide which port the server listens. So
the user can start the server with port 9000, stop the server, change
port to 9001 and start the server again. Or it can just stop and start
the server with the same port for some reason.

So how can I design the server so that it can be started and stopped
as many time as needed? Can I change the port in the created
m_TcpChannel without creating a new instance of it everytime?

Any help will be highly appreciated.

Thank you

AnswerRe: How to disconnect remoting server properly? Pin
Heath Stewart15-Dec-04 22:35
protectorHeath Stewart15-Dec-04 22:35 
GeneralRe: How to disconnect remoting server properly? Pin
kosjanne15-Dec-04 23:04
kosjanne15-Dec-04 23:04 
GeneralRe: How to disconnect remoting server properly? Pin
Heath Stewart15-Dec-04 23:12
protectorHeath Stewart15-Dec-04 23:12 
QuestionUserControl designer bug ? Pin
Gangren15-Dec-04 19:30
Gangren15-Dec-04 19:30 
AnswerRe: UserControl designer bug ? Pin
Jay Shankar15-Dec-04 19:55
Jay Shankar15-Dec-04 19:55 
GeneralRe: UserControl designer bug ? Pin
Gangren15-Dec-04 20:10
Gangren15-Dec-04 20:10 
GeneralRe: UserControl designer bug ? Pin
Jay Shankar15-Dec-04 20:24
Jay Shankar15-Dec-04 20:24 
GeneralRe: UserControl designer bug ? Pin
Jay Shankar15-Dec-04 20:41
Jay Shankar15-Dec-04 20:41 
GeneralRe: UserControl designer bug ? Pin
Gangren15-Dec-04 20:50
Gangren15-Dec-04 20:50 
AnswerRe: UserControl designer bug ? Pin
Gangren16-Dec-04 1:31
Gangren16-Dec-04 1:31 
GeneralRe: UserControl designer bug ? Pin
Jay Shankar16-Dec-04 14:13
Jay Shankar16-Dec-04 14:13 
GeneralRecording wave file in low level Pin
vhunghl15-Dec-04 19:28
vhunghl15-Dec-04 19:28 
GeneralRe: Recording wave file in low level Pin
Daniel Turini15-Dec-04 22:50
Daniel Turini15-Dec-04 22:50 
GeneralRemoving whitespace Pin
kobezt0815-Dec-04 19:18
kobezt0815-Dec-04 19:18 
GeneralRe: Removing whitespace Pin
Gangren15-Dec-04 19:39
Gangren15-Dec-04 19:39 
GeneralRe: Removing whitespace Pin
kobezt0815-Dec-04 19:42
kobezt0815-Dec-04 19:42 
GeneralRe: Removing whitespace Pin
Jay Shankar15-Dec-04 19:45
Jay Shankar15-Dec-04 19:45 

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.