Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am trying to listen for incoming HTTP packets then respond.  I cannot figure out how to respond to an incoming message or to write new messages.

I can use ISockPort_Connect() to write and read messages to a specific IP address, but then ISockPort_Listen() gives me errors when I try to start it.

If I try ISockPort_Listen() first, I cannot figure out how to write messages to a specific IP address.  If I try ISockPort_Connect() I get erros when I try to start it.

How can I listen for incoming message and be able to respond and write new messages if required?

there are 2 approaches:-
1. Writing a TCP server application:
Steps:-

 

Data initialization.

Creating and opening an ISockPort object.

Binding a Sockport.

Listening on a Sockport.

Accepting new connections.

Reading data from a client.

Writing data to a client.

Closing connections. 

refer sample code here:-
https://developer.brewmp.com/forum/isockportconnect-error
 
2. Writing TCP Client Application:-
Steps:-

 

Data initialization.

Creating and opening an ISockPort object.

Connecting to the server.

Writing data to a server.

Reading data from a server.

Closing a SockPort.

there are 2 approaches:-
1. Writing a TCP server application:
Steps:-

 

Data initialization.

Creating and opening an ISockPort object.

Binding a Sockport.

Listening on a Sockport.

Accepting new connections.

Reading data from a client.

Writing data to a client.

Closing connections. 

refer sample code here:-
https://developer.brewmp.com/forum/isockportconnect-error
 
2. Writing TCP Client Application:-
Steps:-

 

Data initialization.

Creating and opening an ISockPort object.

Connecting to the server.

Writing data to a server.

Reading data from a server.

Closing a SockPort.