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

C#

 
AnswerRe: doubt Pin
Eddy Vluggen3-Mar-09 23:15
professionalEddy Vluggen3-Mar-09 23:15 
QuestionHow use Barcodes in Crystal Reports Pin
dasha_pl3-Mar-09 22:32
dasha_pl3-Mar-09 22:32 
AnswerRe: How use Barcodes in Crystal Reports Pin
Megidolaon4-Mar-09 2:19
Megidolaon4-Mar-09 2:19 
GeneralRe: How use Barcodes in Crystal Reports Pin
dasha_pl4-Mar-09 2:43
dasha_pl4-Mar-09 2:43 
Questiondoubt Pin
divya.simma3-Mar-09 22:27
divya.simma3-Mar-09 22:27 
AnswerRe: doubt Pin
Greg Chelstowski3-Mar-09 22:40
Greg Chelstowski3-Mar-09 22:40 
AnswerRe: doubt Pin
Xmen Real 4-Mar-09 4:30
professional Xmen Real 4-Mar-09 4:30 
QuestionServer Pin
mrithula83-Mar-09 21:38
mrithula83-Mar-09 21:38 
Hi,
this is my server code...Once i it recieves the message from the client it just closes..So im not able to see the received message in the server...
I want to call the server again so that it will stay alive for a long time...
I tried by calling the start() method again...Can you give me some suggestions
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class UdpServer
{
    public static void Main()
    {
        try
        {
            int recv;
            byte[] data = new byte[1024];
          //  bool done = false;
            while (true)
            {
                IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9050);
                Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                // newsock.Bind(ipep);
                newsock.Start();

                Console.WriteLine("Waiting for a client...");

                IPEndPoint sender = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9050);
                EndPoint tmpRemote = (EndPoint)(sender);

                recv = newsock.ReceiveFrom(data, ref tmpRemote);
                Console.ReadLine();
                Console.WriteLine("Message received from {0}:", tmpRemote.ToString());
                Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));//hello is received           

                data = new byte[1024];
                string ss = "Welcome to the Server";
                data = Encoding.ASCII.GetBytes(ss);
                newsock.SendTo(data, data.Length, SocketFlags.None, tmpRemote);

                Console.WriteLine("\nSent Acknowledgement");
                
                
            }
             
            
           // newsock.Close();           
        }
        catch (Exception e)
        {
            Console.WriteLine("Error..... " + e.StackTrace);          
        }
        Console.ReadLine();
       
    }
}

Questiontiny encryption algorithm based on videos Pin
rohan40403-Mar-09 21:15
rohan40403-Mar-09 21:15 
AnswerRe: tiny encryption algorithm based on videos Pin
CPallini4-Mar-09 0:24
mveCPallini4-Mar-09 0:24 
JokeRe: tiny encryption algorithm based on videos Pin
Xmen Real 4-Mar-09 4:28
professional Xmen Real 4-Mar-09 4:28 
AnswerRe: tiny encryption algorithm based on videos Pin
Megidolaon4-Mar-09 2:20
Megidolaon4-Mar-09 2:20 
Questionhow to convert an image into pixel matrix using C#.net Pin
rohan40403-Mar-09 21:14
rohan40403-Mar-09 21:14 
QuestionRe: how to convert an image into pixel matrix using C#.net Pin
CPallini4-Mar-09 0:26
mveCPallini4-Mar-09 0:26 
QuestionHow to generate ENCRYPTED html file to pdf file using itext with C# Pin
YiXiang_893-Mar-09 21:08
YiXiang_893-Mar-09 21:08 
AnswerRe: How to generate ENCRYPTED html file to pdf file using itext with C# Pin
Christian Graus3-Mar-09 21:11
protectorChristian Graus3-Mar-09 21:11 
GeneralRe: How to generate ENCRYPTED html file to pdf file using itext with C# [modified] Pin
YiXiang_893-Mar-09 21:51
YiXiang_893-Mar-09 21:51 
Answerplease send any suggetion in project Pin
mulla md fozail3-Mar-09 23:33
mulla md fozail3-Mar-09 23:33 
Questionsplitting an image of any type Pin
rohan40403-Mar-09 21:08
rohan40403-Mar-09 21:08 
AnswerRe: splitting an image of any type Pin
Christian Graus3-Mar-09 21:12
protectorChristian Graus3-Mar-09 21:12 
QuestionGet only updated and newly record Pin
Abdul Rahman Hamidy3-Mar-09 20:54
Abdul Rahman Hamidy3-Mar-09 20:54 
AnswerRe: Get only updated and newly record Pin
Christian Graus3-Mar-09 21:07
protectorChristian Graus3-Mar-09 21:07 
GeneralRe: Get only updated and newly record Pin
Abdul Rahman Hamidy3-Mar-09 22:03
Abdul Rahman Hamidy3-Mar-09 22:03 
GeneralRe: Get only updated and newly record Pin
Abdul Rahman Hamidy3-Mar-09 22:13
Abdul Rahman Hamidy3-Mar-09 22:13 
GeneralRe: Get only updated and newly record Pin
Shyam K Pananghat3-Mar-09 23:15
Shyam K Pananghat3-Mar-09 23:15 

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.