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

C#

 
GeneralRe: Killing hidden processes Pin
Rajesh R Subramanian7-Apr-11 9:59
professionalRajesh R Subramanian7-Apr-11 9:59 
GeneralRe: Killing hidden processes Pin
Pete O'Hanlon7-Apr-11 10:07
mvePete O'Hanlon7-Apr-11 10:07 
GeneralRe: Killing hidden processes Pin
Rajesh R Subramanian7-Apr-11 10:16
professionalRajesh R Subramanian7-Apr-11 10:16 
GeneralRe: Killing hidden processes Pin
David19878-Apr-11 1:46
David19878-Apr-11 1:46 
GeneralRe: Killing hidden processes Pin
teknolog1239-Apr-11 2:32
teknolog1239-Apr-11 2:32 
GeneralRe: Killing hidden processes Pin
David19879-Apr-11 2:36
David19879-Apr-11 2:36 
GeneralRe: Killing hidden processes Pin
teknolog1239-Apr-11 6:45
teknolog1239-Apr-11 6:45 
QuestionSocket Exception Pin
Paul Harsent6-Apr-11 5:27
Paul Harsent6-Apr-11 5:27 
I am trying to connect to a tcp listener, after I hit the clint.Connect(server, port) it throughts a SocketException

public void Connect(String server, String message)
        {
            try
            {
                StreamWriter sw;
                StreamReader sr;

                int port = 5000;
                TcpClient client = new TcpClient(server, port);

                client.Connect(server, port);


                sw = new StreamWriter(client.GetStream());

                sr = new StreamReader(client.GetStream());


                sw.WriteLine(message);
                sw.Flush();
                
                string rtnMsg = sr.ReadToEnd().Trim();

            }
            catch (ArgumentNullException e)
            {
                Console.WriteLine("ArgumentNullException: {0}", e);
            }
            catch (SocketException e)
            {
                Console.WriteLine("SocketException: {0}", e);
            }
            catch (IOException e)
            {

            }
            catch (NullReferenceException e)
            {

            }

            Console.WriteLine("\n Press Enter to continue...");
            Console.Read();
        }


Any help would be really helpful.
AnswerRe: Socket Exception Pin
Pete O'Hanlon6-Apr-11 6:06
mvePete O'Hanlon6-Apr-11 6:06 
GeneralRe: Socket Exception Pin
Paul Harsent6-Apr-11 6:09
Paul Harsent6-Apr-11 6:09 
GeneralRe: Socket Exception Pin
Pete O'Hanlon6-Apr-11 6:21
mvePete O'Hanlon6-Apr-11 6:21 
GeneralRe: Socket Exception Pin
#realJSOP6-Apr-11 9:07
mve#realJSOP6-Apr-11 9:07 
GeneralRe: Socket Exception Pin
Pete O'Hanlon6-Apr-11 9:13
mvePete O'Hanlon6-Apr-11 9:13 
GeneralRe: Socket Exception Pin
ankitjoshi246-Apr-11 9:40
ankitjoshi246-Apr-11 9:40 
AnswerRe: Socket Exception Pin
Luc Pattyn6-Apr-11 6:57
sitebuilderLuc Pattyn6-Apr-11 6:57 
GeneralParallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 5:12
professionalBassam Abdul-Baki6-Apr-11 5:12 
GeneralRe: Parallel.For Issue Pin
David19876-Apr-11 5:19
David19876-Apr-11 5:19 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 5:25
professionalBassam Abdul-Baki6-Apr-11 5:25 
AnswerRe: Parallel.For Issue Pin
Luc Pattyn6-Apr-11 5:25
sitebuilderLuc Pattyn6-Apr-11 5:25 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 5:29
professionalBassam Abdul-Baki6-Apr-11 5:29 
GeneralRe: Parallel.For Issue Pin
David19876-Apr-11 5:31
David19876-Apr-11 5:31 
GeneralRe: Parallel.For Issue Pin
Luc Pattyn6-Apr-11 6:32
sitebuilderLuc Pattyn6-Apr-11 6:32 
GeneralRe: Parallel.For Issue Pin
BobJanova6-Apr-11 6:31
BobJanova6-Apr-11 6:31 
GeneralRe: Parallel.For Issue Pin
AspDotNetDev6-Apr-11 7:07
protectorAspDotNetDev6-Apr-11 7:07 
GeneralRe: Parallel.For Issue Pin
Bassam Abdul-Baki6-Apr-11 14:13
professionalBassam Abdul-Baki6-Apr-11 14:13 

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.