Article View: chile.comp.programacion
Article #459Re: Consulta Socket
From: Pintamono
Date: Fri, 10 Jul 2009 02:19
Date: Fri, 10 Jul 2009 02:19
61 lines
3273 bytes
3273 bytes
Si, gracias, se me olvida lo del lenguaje...
Al parecer es un tema con el servidor remoto, eso lo vamos a ver magnana
Gracias.
"Rick_oj" <rick_oj[sin-esto]@tutopia.com> wrote in message
news:h3607d$far$1@news.nivel5.cl...
> Pintamono wrote:
>> Estoy haciendo un servicio que se encarga de conectarse a otro
>> servicio via socket, para ello estoy usando el codigo de la pagina de
>> ejemplo de microsoft, pero tengo un pequegno problema...
>>
>> try
>> {
>> // Establish the remote endpoint for the socket.
>> // The name of the
>> // remote device is "host.contoso.com".
>> //IPHostEntry ipHostInfo =
>> Dns.GetHostByName("localhost"); IPAddress ipAddress =
>> Dns.GetHostEntry("[IP_DEL_SERVER]").AddressList[0];
>> IPEndPoint remoteEP = new IPEndPoint(ipAddress, port);
>>
>> // Create a TCP/IP socket.
>> Socket client = new Socket(AddressFamily.InterNetwork,
>> SocketType.Stream, ProtocolType.Tcp);
>>
>> // Connect to the remote endpoint.
>> client.BeginConnect(remoteEP,
>> new AsyncCallback(ConnectCallback), client);
>> connectDone.WaitOne();
>>
>> // Send test data to the remote device.
>> Send(client, psMensaje);
>> sendDone.WaitOne();
>>
>> // Receive the response from the remote device.
>> Receive(client);
>> receiveDone.WaitOne();
>>
>> // Release the socket.
>> client.Shutdown(SocketShutdown.Both);
>> client.Close();
>>
>> }
>>
>> se me queda pegado en el "sendDone.WaitOne()", ahi se queda por un
>> rato, no cacho si es por mi codigo o porque el servidor no ha
>> contestado nada...
>>
>> estoy en lo correcto?
>
> seria util que dijeras en que lenguaje, ya que las bolas maginas en este
> momento estan offline, segun entendi mirando lo de microsoft
> eso es C#
>
> como ni idea de C#, te dejo este link que no se si lo revisaste o no
> http://www.foromsn.com/Version_Imprimible.php?Id=139962
>
>
>
Technical Details
Message-ID:
<h368fo$ji1$1@jagger.tie.cl>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!news.tie.cl!not-for-mailReferences:
<c0e93edb27cb050e7824e729c995d4a0$1@usenet.no-ip.com> <h3607d$far$1@news.nivel5.cl>Show Full Headers
Complete Article Headers
X-Google-Thread: e499fe1f24,69afe79b0d04a827 X-Google-Attributes: gide499fe1f24,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!news.tie.cl!not-for-mail From: "Pintamono" <pintamono@NoMandeWeas.kk> Newsgroups: chile.comp.programacion Subject: Re: Consulta Socket Date: Thu, 9 Jul 2009 22:19:39 -0400 Organization: Telefonica Internet Empresa Lines: 63 Message-ID: <h368fo$ji1$1@jagger.tie.cl> References: <c0e93edb27cb050e7824e729c995d4a0$1@usenet.no-ip.com> <h3607d$far$1@news.nivel5.cl> NNTP-Posting-Host: 201.236.18.54 X-Trace: jagger.tie.cl 1247192377 20033 201.236.18.54 (10 Jul 2009 02:19:37 GMT) X-Complaints-To: news@jagger.tie.cl NNTP-Posting-Date: Fri, 10 Jul 2009 02:19:37 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.3959 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325 X-RFC2646: Format=Flowed; Response