Click here to Skip to main content
15,797,960 members
Home / Discussions / C#
   

C#

 
GeneralRe: Advices for my learning path Pin
Richard MacCutchan10-Jul-23 22:55
mveRichard MacCutchan10-Jul-23 22:55 
AnswerRe: Advices for my learning path Pin
Gerry Schmitz18-Jul-23 7:03
mveGerry Schmitz18-Jul-23 7:03 
GeneralRe: Advices for my learning path Pin
coco24319-Jul-23 19:36
coco24319-Jul-23 19:36 
QuestionGoogle People API Error Pin
Kevin Marois6-Jul-23 11:54
professionalKevin Marois6-Jul-23 11:54 
AnswerRe: Google People API Error Pin
OriginalGriff6-Jul-23 19:30
mvaOriginalGriff6-Jul-23 19:30 
GeneralRe: Google People API Error Pin
Kevin Marois7-Jul-23 7:26
professionalKevin Marois7-Jul-23 7:26 
GeneralRe: Google People API Error Pin
OriginalGriff7-Jul-23 7:45
mvaOriginalGriff7-Jul-23 7:45 
Questionwhy the data been sent out after socket.close(), not socket.send(). Pin
viming4-Jul-23 17:06
viming4-Jul-23 17:06 
try
            {
                string message = "device=camera;item=ois;command=start;\\r\\n";
                byte[] bytes = Encoding.ASCII.GetBytes(message);
                Socket s = null;
                IPEndPoint hostEndPoint;
                IPAddress hostAddress = null;
                int conPort = 80;

                hostAddress = IPAddress.Parse("127.0.0.1");
                hostEndPoint = new IPEndPoint(hostAddress, 9103);

                // Creates the Socket to send data over a TCP connection.
                s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                s.ReceiveTimeout = 1000*15;

                // Connect to the host using its IPEndPoint.
                s.Connect(hostEndPoint);

                if (!s.Connected)
                {
                    // Connection failed, try next IPaddress.
                    Console.WriteLine("Unable to connect to host");

                }
                s.Send(bytes);
                s.Close();
            }

as my thought, the data should be sent out after sockct.send. but actually it don't work. the data been sent out after socket.close. i had been stuck by this 2 days. i had searched information using bing and google 2 days, nothing useful. it is suffering. it is appreciated for any suggestion. thanks.

[edit]
Closing <pre> tag added - OriginalGriff
[/edit]
i want to best


modified 5-Jul-23 0:10am.

AnswerRe: why the data been sent out after socket.close(), not socket.send(). Pin
OriginalGriff4-Jul-23 19:19
mvaOriginalGriff4-Jul-23 19:19 
GeneralRe: why the data been sent out after socket.close(), not socket.send(). Pin
viming4-Jul-23 22:05
viming4-Jul-23 22:05 
GeneralRe: why the data been sent out after socket.close(), not socket.send(). Pin
OriginalGriff4-Jul-23 22:14
mvaOriginalGriff4-Jul-23 22:14 
AnswerRe: why the data been sent out after socket.close(), not socket.send(). Pin
jschell5-Jul-23 6:26
jschell5-Jul-23 6:26 
QuestionProblem with string array? Pin
Member 140558794-Jul-23 7:28
Member 140558794-Jul-23 7:28 
AnswerRe: Problem with string array? Pin
Dave Kreskowiak4-Jul-23 8:06
mveDave Kreskowiak4-Jul-23 8:06 
AnswerRe: Problem with string array? Pin
OriginalGriff4-Jul-23 19:21
mvaOriginalGriff4-Jul-23 19:21 
GeneralRe: Problem with string array? Pin
jschell5-Jul-23 6:28
jschell5-Jul-23 6:28 
QuestionPredicateBuilder Question Pin
Kevin Marois30-Jun-23 9:54
professionalKevin Marois30-Jun-23 9:54 
AnswerRe: PredicateBuilder Question Pin
Dave Kreskowiak1-Jul-23 5:23
mveDave Kreskowiak1-Jul-23 5:23 
GeneralRe: PredicateBuilder Question Pin
Kevin Marois1-Jul-23 9:21
professionalKevin Marois1-Jul-23 9:21 
AnswerRe: PredicateBuilder Question Pin
BillWoodruff1-Jul-23 10:54
professionalBillWoodruff1-Jul-23 10:54 
AnswerRe: PredicateBuilder Question Pin
James Curran5-Jul-23 11:41
James Curran5-Jul-23 11:41 
QuestionUnable to Receive data from Cobas e411 Serial Port Pin
Member 1493027227-Jun-23 23:20
Member 1493027227-Jun-23 23:20 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
Richard MacCutchan28-Jun-23 0:08
mveRichard MacCutchan28-Jun-23 0:08 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
OriginalGriff28-Jun-23 0:38
mvaOriginalGriff28-Jun-23 0:38 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
Ralf Meier28-Jun-23 1:43
professionalRalf Meier28-Jun-23 1:43 

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.