Click here to Skip to main content
15,898,614 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# window app to listen multiple port simultaneously.. Pin
Luc Pattyn2-Dec-10 0:38
sitebuilderLuc Pattyn2-Dec-10 0:38 
GeneralRe: C# window app to listen multiple port simultaneously.. Pin
ayandelhi2-Dec-10 5:57
ayandelhi2-Dec-10 5:57 
AnswerRe: C# window app to listen multiple port simultaneously.. Pin
Luc Pattyn2-Dec-10 5:59
sitebuilderLuc Pattyn2-Dec-10 5:59 
GeneralRe: C# window app to listen multiple port simultaneously.. Pin
ayandelhi2-Dec-10 6:09
ayandelhi2-Dec-10 6:09 
GeneralRe: C# window app to listen multiple port simultaneously.. Pin
Luc Pattyn2-Dec-10 6:35
sitebuilderLuc Pattyn2-Dec-10 6:35 
GeneralRe: C# window app to listen multiple port simultaneously.. Pin
ayandelhi2-Dec-10 6:44
ayandelhi2-Dec-10 6:44 
GeneralRe: C# window app to listen multiple port simultaneously.. Pin
DaveyM692-Dec-10 9:37
professionalDaveyM692-Dec-10 9:37 
QuestionSocket programming Pin
Tichaona J1-Dec-10 23:29
Tichaona J1-Dec-10 23:29 
Hi I have two application which I have managed to get them to exchange data however, I would like to be able to sort the data out when it is recieved by the other end (server). On the client side, the data is taken from the various forms and sent as below:

  String Pname = LblName.Text;
 String Pdob = LblDOB.Text;
 String PnhsNo = LblNHSno.Text;
 String Paddress = RtxtBxAddre.Text;
 String PmedicalCon = RtxtBxMedCon.Text;
 String pcallOutDetails = RTxtBxCallOut.Text;

 byte[] forwardMessage = Encoding.ASCII.GetBytes(Pname + Pdob + PnhsNo + Paddress + PmedicalCon + pcallOutDetails);
sock.Send(forwardMessage);

 sock.Shutdown(SocketShutdown.Both);
 sock.Close();


On the other end I would now like to take each item and display it in a form, so "Pname" is taken when received and displayed in a text box and then same with the rest of the data. Unlike displaying it in a message box like I have done below:



Socket listener = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
          listener.Bind(new IPEndPoint(IPAddress.Any, 2112));
          listener.Listen(10);

                  
           Socket socket = listener.Accept();
           string receivedValue = string.Empty;

           
                     byte[] receivedBytes = new byte[1024];
                      int numBytes = socket.Receive(receivedBytes);
                          
                              receivedValue = Encoding.ASCII.GetString(receivedBytes,0, numBytes);
                             
                                    MessageBox.Show(receivedValue);
                                                                    
                                    listener.Close();


Help....Confused | :confused:
AnswerRe: Socket programming Pin
Pete O'Hanlon1-Dec-10 23:47
mvePete O'Hanlon1-Dec-10 23:47 
AnswerRe: Socket programming Pin
Luc Pattyn2-Dec-10 0:04
sitebuilderLuc Pattyn2-Dec-10 0:04 
GeneralRe: Socket programming Pin
musefan2-Dec-10 0:12
musefan2-Dec-10 0:12 
GeneralRe: Socket programming Pin
Tichaona J2-Dec-10 1:28
Tichaona J2-Dec-10 1:28 
GeneralRe: Socket programming Pin
musefan2-Dec-10 1:34
musefan2-Dec-10 1:34 
GeneralRe: Socket programming Pin
Luc Pattyn2-Dec-10 2:20
sitebuilderLuc Pattyn2-Dec-10 2:20 
AnswerRe: Socket programming Pin
Tichaona J2-Dec-10 4:08
Tichaona J2-Dec-10 4:08 
QuestionConversion of a object into a particular datetime format Pin
Varun Sareen1-Dec-10 17:43
Varun Sareen1-Dec-10 17:43 
AnswerRe: Conversion of a object into a particular datetime format PinPopular
OriginalGriff1-Dec-10 21:38
mveOriginalGriff1-Dec-10 21:38 
QuestionCan not deserialize [modified] Pin
Jacob D Dixon1-Dec-10 11:39
Jacob D Dixon1-Dec-10 11:39 
AnswerRe: Can not deserialize Pin
jschell1-Dec-10 12:16
jschell1-Dec-10 12:16 
AnswerRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 12:17
sitebuilderLuc Pattyn1-Dec-10 12:17 
GeneralRe: Can not deserialize Pin
Jacob D Dixon1-Dec-10 12:30
Jacob D Dixon1-Dec-10 12:30 
AnswerRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 13:06
sitebuilderLuc Pattyn1-Dec-10 13:06 
GeneralRe: Can not deserialize Pin
Jacob D Dixon1-Dec-10 14:48
Jacob D Dixon1-Dec-10 14:48 
AnswerRe: Can not deserialize Pin
Luc Pattyn1-Dec-10 15:02
sitebuilderLuc Pattyn1-Dec-10 15:02 
GeneralRe: Can not deserialize Pin
Jacob D Dixon1-Dec-10 16:21
Jacob D Dixon1-Dec-10 16:21 

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.