News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Chat in mode consola

Started by Richard, May 25, 2005, 05:15:22 AM

Previous topic - Next topic

Richard

Hi,

Thomas ¿example?
I don´t undertand.

Thank. :U

Richard.

Tedd

Thomas means you can use WSAAsyncSelect so you don't have wait each time when you call recv - you will get a 'message' to tell you.
But for now, just keep it simple :wink
No snowflake in an avalanche feels responsible.

QvasiModo

Quote from: Richard on June 02, 2005, 10:55:24 PM
Gracias QvasiModo  :U

Como configuro la aplicación cliente -  servidor,  para que cuando el cliente envie, el servidor reciba y viceversa y muestre por pantalla. Las funciones estan implementadas pero cuando uso
invoke recv,s1,edit,SIZEOF edit,0   me muestra  error de sockect.

de nuevo muchas gracias.


Richard

Translation:
Quote
How do I configure the client - server application, so that when the client sends, the server receives and viscecersa, and output the data to screen? The functions are implemented but when I use:

invoke recv,s1,edit,SIZEOF edit,0

I get a socket error. Thank you very much again.

Creo que deberías usar esta línea (estoy suponiendo que "edit" es un arreglo de caracteres):

invoke recv,s1,ADDR edit,SIZEOF edit,0

De otra forma, MASM cree que "edit" es un puntero a DWORD y lo lee como tal. Seguramente querías pasarle a recv el puntero al buffer, no los primeros cuatro bytes del mismo. ;)

Salu2

thomasantony

Hey guys,
  I know only 3 human languges out of which only one is useful here. Would you mind speaking in a language most people can understand  :boohoo: :naughty: :naughty: :green :green :toothy :bdg

Thomas :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

Tedd

Quote from: thomasantony on June 07, 2005, 03:35:45 AM
Hey guys,
  I know only 3 human languges out of which only one is useful here. Would you mind speaking in a language most people can understand  :boohoo: :naughty: :naughty: :green :green :toothy :bdg

Thomas :U

Qvasi's help is for Richard, not for you :P
Richard's english isn't perfect, so it's easier to get the point across using his language insted of english.
Don't worry, you're not missing out on anything :bdg
No snowflake in an avalanche feels responsible.

Richard

Hi,
I want to know how to see when to receive?
I want to know how receive?

With the examples  I get a error when  invoke recv,s1,ADDR edit,SIZEOF edit,0 :(

Please help me,

Thank.  :U

Richard


Tedd

Quote from: Richard on June 07, 2005, 02:35:20 PM
Hi,
I want to know how to see when to receive?
I want to know how receive?

With the examples  I get a error when  invoke recv,s1,ADDR edit,SIZEOF edit,0 :(

Please help me,

Thank.  :U

Richard


I told you - you do not know when.
If you recv but there is nothing, then it will wait until there is something.
If you get an error, then there is something wrong in a different place :wink

What is the error you have??
No snowflake in an avalanche feels responsible.

Richard

    invoke recv,s2,ADDR RecBuff,SIZEOF RecBuff,0
    cmp eax,SOCKET_ERROR
   
je errorecibe
   
    The program jump to the error when cmp eax, SOCKECT_ERROR

QvasiModo

@Thomas: Don't worry, when I post something I want you to read I'll do it in english ::) :bg

@Richard: Can we see the code where you create the socket?

Richard

QvasiModo gracias por ayudarme :U

Richard





[attachment deleted by admin]

Phil

I can't believe that someone objected to clear communication after all the ones and zeros we pass along here! I enjoyed seeing the Spanish, I'd guess it was, and even understood some of it! Especially the Gracias! I'm almost fluent in American-eze, understand most English, some Australian ... but I always enjoy seeing other languages! Frankly though, I just don't understand how those symbolic languages like Chinese work but they certainly have some beautiful characters!

Tedd

Richard: I'm afraid you have many errors in the program. I think you need to read more about winsock programming to understand better :wink


What is the purpose of socket 's1' ?
No snowflake in an avalanche feels responsible.

Richard

s1 is a variable type socket. With the that it establishes the conexion initial.

s1        SOCKET ?

thomasantony

Hi Richard,
   How did you define the buffer 'edit'? You should do something like the one below

.data?
edit db 255 dup(?) ; reserve 255 bytes for recieving the data. Also if you use recv directly, it will hang your program forever, Yu can also use the sleect function to wait for a specific time interval after which the program stops waiting for data. Read the winsock tutorial at

http://www.madwizard.org/

It will help you a lot

Thomas :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

Tedd

Richard: it's obvious you don't really understand the code you have 'written.'
Using sockets is not very simple, but it is not that difficult when you understand how it works. But you do need to try before you can understand it - which means reading a little more than stealing from examples on the web.
I think you have had too much help, and are not really trying.



This thread should be closed.
No snowflake in an avalanche feels responsible.