Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
GeneralRe: Returning Random Unicode Characters Pin
Alan Balkany31-Mar-09 8:37
Alan Balkany31-Mar-09 8:37 
QuestionHow to check all the checkboxes in atree at a time Pin
Nekkantidivya31-Mar-09 0:57
Nekkantidivya31-Mar-09 0:57 
AnswerRe: How to check all the checkboxes in atree at a time Pin
Mustafa Ismail Mustafa31-Mar-09 1:02
Mustafa Ismail Mustafa31-Mar-09 1:02 
QuestionTo Create or to Clear Pin
musefan31-Mar-09 0:37
musefan31-Mar-09 0:37 
AnswerRe: To Create or to Clear Pin
SeMartens31-Mar-09 0:46
SeMartens31-Mar-09 0:46 
GeneralRe: To Create or to Clear Pin
musefan31-Mar-09 0:50
musefan31-Mar-09 0:50 
AnswerRe: To Create or to Clear Pin
PIEBALDconsult31-Mar-09 7:26
mvePIEBALDconsult31-Mar-09 7:26 
QuestionClient and Server Program Pin
Vinziee31-Mar-09 0:28
Vinziee31-Mar-09 0:28 
A hi to all programming gurus
i am an amature in network programming i have written an simple program for making a client and server in c#
the cleint sends a msg and the server displays it in the listbox(lbconnections)
The Problem is that----
this application runs perfectly after being deployed and afterward when i again use it it crashes (port already bieng used error)
plz help me with this plzzzzzzzzzzzzzzzzzzzzzzzz..............Confused | :confused: Confused | :confused: Confused | :confused:

********************************coding for server*******************************************
using System;
using System.Threading;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Net;

namespace server
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void recieve()
{
try
{
UdpClient server = new UdpClient(8080);
while (true)
{
IPEndPoint ip = new IPEndPoint(IPAddress.Any, 0);
byte[] recieved = server.Receive(ref ip);
string returndata = Encoding.ASCII.GetString(recieved);
listBox1.Items.Add(ip.Address.ToString() + " : " + returndata.ToString());

}
}
catch (SocketException ex)
{
MessageBox.Show(ex.Message);
}
}

private void Form1_Load(object sender, EventArgs e)
{
Thread server = new Thread(new ThreadStart(recieve));
server.Start();
}
}
}

***************************************CODING FOR CLIENT*********************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Net;

namespace ser_cli
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
UdpClient client = new UdpClient();
client.Connect(tbHost.Text, 8080);
byte[] send = Encoding.ASCII.GetBytes("HELLO WORLD?");
client.Send(send, send.Length);

}
}
}
AnswerRe: Client and Server Program Pin
SeMartens31-Mar-09 0:39
SeMartens31-Mar-09 0:39 
GeneralRe: Client and Server Program Pin
Vinziee31-Mar-09 1:22
Vinziee31-Mar-09 1:22 
GeneralRe: Client and Server Program Pin
SeMartens31-Mar-09 1:54
SeMartens31-Mar-09 1:54 
GeneralRe: Client and Server Program Pin
Vinziee31-Mar-09 2:31
Vinziee31-Mar-09 2:31 
GeneralRe: Client and Server Program Pin
SeMartens31-Mar-09 2:57
SeMartens31-Mar-09 2:57 
GeneralRe: Client and Server Program Pin
Vinziee31-Mar-09 4:27
Vinziee31-Mar-09 4:27 
GeneralRe: Client and Server Program Pin
0x3c031-Mar-09 7:02
0x3c031-Mar-09 7:02 
GeneralRe: Client and Server Program Pin
Vinziee1-Apr-09 0:28
Vinziee1-Apr-09 0:28 
GeneralRe: Client and Server Program Pin
SeMartens31-Mar-09 9:18
SeMartens31-Mar-09 9:18 
GeneralRe: Client and Server Program Pin
Vinziee1-Apr-09 0:29
Vinziee1-Apr-09 0:29 
AnswerRe: Client and Server Program Pin
musefan31-Mar-09 0:49
musefan31-Mar-09 0:49 
GeneralRe: Client and Server Program Pin
Vinziee31-Mar-09 1:23
Vinziee31-Mar-09 1:23 
GeneralRe: Client and Server Program Pin
EliottA31-Mar-09 2:15
EliottA31-Mar-09 2:15 
AnswerRe: Client and Server Program Pin
agent00zelda31-Mar-09 2:30
agent00zelda31-Mar-09 2:30 
GeneralRe: Client and Server Program Pin
Vinziee31-Mar-09 2:35
Vinziee31-Mar-09 2:35 
QuestionRotate and Resize a Rectangle Pin
Madmanxxx30-Mar-09 23:34
Madmanxxx30-Mar-09 23:34 
AnswerRe: Rotate and Resize a Rectangle Pin
Mustafa Ismail Mustafa30-Mar-09 23:40
Mustafa Ismail Mustafa30-Mar-09 23:40 

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.