Click here to Skip to main content
15,887,886 members
Home / Discussions / C#
   

C#

 
QuestionRun Winform at Startup Pin
Abdul Rahman Hamidy7-Sep-09 18:12
Abdul Rahman Hamidy7-Sep-09 18:12 
AnswerRe: Run Winform at Startup Pin
N a v a n e e t h7-Sep-09 18:20
N a v a n e e t h7-Sep-09 18:20 
AnswerRe: Run Winform at Startup Pin
Christian Graus7-Sep-09 18:34
protectorChristian Graus7-Sep-09 18:34 
GeneralRe: Run Winform at Startup Pin
N a v a n e e t h7-Sep-09 18:39
N a v a n e e t h7-Sep-09 18:39 
GeneralRe: Run Winform at Startup Pin
Abdul Rahman Hamidy7-Sep-09 19:53
Abdul Rahman Hamidy7-Sep-09 19:53 
QuestionViewing bytes of a video being played by windows media object Pin
FoxholeNorman7-Sep-09 17:42
FoxholeNorman7-Sep-09 17:42 
AnswerRe: Viewing bytes of a video being played by windows media object Pin
Christian Graus7-Sep-09 18:02
protectorChristian Graus7-Sep-09 18:02 
Questionserver and client on same PC - port conflict Pin
sirEgGhEaD7-Sep-09 13:23
sirEgGhEaD7-Sep-09 13:23 
I recently made a server and client in separate EXEs and I would like to run both on one PC. The server is listening on port 19357 and of course the client will connect via the same port. Of course this causes a conflict and an exception is thrown. I know it is possible to do this, I just don't know what I'm missing. For now I have a 'bandaid' on the problem by changing the port that the client connects through and forwarding the port through my router to the correct port. However I do not wish to use this as a permanent solution.

My server uses the following code to listen:
tlsClient = new TcpListener(19357);
tlsClient.Start();


My client uses the following code to connect:
tcpServer.Connect(strHost, 19357);


And of course my threaded to keep listening for incoming connections.

I can change the address in my client to 127.0.0.1 without any problems, but if I try to use my domain as the address on the PC that is running the host, I get an error about the port being in use. I know it is possible to connect in the method that I'm talking about because I am running Apache web server on this PC and I am able to connect to the server with a web browser using my domain as the address. But of course when I go check to see what ports are in use, i get some random number as the local port and 80 as the remote port. The web browser just cycles through ports on the local side until it finds one not in use while still connecting to the proper port on the remote end. How can I do this with my program?


Thanks,
Thomas
AnswerRe: server and client on same PC - port conflict Pin
Richard Andrew x647-Sep-09 14:33
professionalRichard Andrew x647-Sep-09 14:33 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD7-Sep-09 15:28
sirEgGhEaD7-Sep-09 15:28 
GeneralRe: server and client on same PC - port conflict Pin
Richard Andrew x647-Sep-09 15:38
professionalRichard Andrew x647-Sep-09 15:38 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD7-Sep-09 15:46
sirEgGhEaD7-Sep-09 15:46 
GeneralRe: server and client on same PC - port conflict Pin
Richard Andrew x647-Sep-09 15:50
professionalRichard Andrew x647-Sep-09 15:50 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD7-Sep-09 15:52
sirEgGhEaD7-Sep-09 15:52 
GeneralRe: server and client on same PC - port conflict Pin
Richard Andrew x647-Sep-09 16:03
professionalRichard Andrew x647-Sep-09 16:03 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD7-Sep-09 16:11
sirEgGhEaD7-Sep-09 16:11 
GeneralRe: server and client on same PC - port conflict Pin
Richard Andrew x647-Sep-09 16:14
professionalRichard Andrew x647-Sep-09 16:14 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD7-Sep-09 16:23
sirEgGhEaD7-Sep-09 16:23 
GeneralRe: server and client on same PC - port conflict Pin
Richard Andrew x647-Sep-09 16:27
professionalRichard Andrew x647-Sep-09 16:27 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD8-Sep-09 5:24
sirEgGhEaD8-Sep-09 5:24 
GeneralRe: server and client on same PC - port conflict Pin
sirEgGhEaD8-Sep-09 6:56
sirEgGhEaD8-Sep-09 6:56 
Questionvalidate an email address Pin
Jassim Rahma7-Sep-09 9:24
Jassim Rahma7-Sep-09 9:24 
AnswerRe: validate an email address Pin
Manas Bhardwaj7-Sep-09 9:27
professionalManas Bhardwaj7-Sep-09 9:27 
GeneralRe: validate an email address Pin
Jassim Rahma7-Sep-09 9:32
Jassim Rahma7-Sep-09 9:32 
GeneralRe: validate an email address Pin
Manas Bhardwaj7-Sep-09 9:34
professionalManas Bhardwaj7-Sep-09 9:34 

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.