TCP library Auto connection support needed
Posted: 21 Jan 2020 15:02
hi,
Am trying library example HTTP DEMO code of ENC24J600 network Library for different controller.
MCU : Dspic33FJ128GP306 i/p
Library : Network_Ethernet_dsPIC (Net_Ethernet_24J600)
In my recent project i was replying to the TCP request which receive from TCP client which is successfully tested.
And now i need to config the controller as a client which send continues response/reply to the server or other interface soft/ module without receiving any request from other end.
am using predefined remote_IP , Port and other network settings.
i was trying using Net_Ethernet_24j600_connectTCP(sysIpAddr, System_Port, My_Port, &sock1); and Net_Ethernet_24j600_startSendTCP(sock1); functions.
But the problem is i have to start initiate request from otherend or PC so that it gettinh start communicate with remote host.
how to start connect and communicate without any request from remote host?
This is the USEr TCP () :
void Net_Ethernet_24j600_UserTCP(SOCKET_24j600_Dsc *socket) {
Uint Reply_Length = 0,Max_request_Len = 7;
Uchar i =0;
// I listen only to web request on port 502 (TCP PORT )
if(socket->destPort != My_Port) {
return;
}
Reply_Length = _REPLY_STRING_LEN;
Net_Ethernet_24j600_putBytesTCP(ETH_Reply_Buf, Reply_Length, socket); //Send temp buffer
/* if( Net_Ethernet_24j600_bufferEmptyTCP(socket)&&(ETH_Reply_Buf >= 2000) ) {
Net_Ethernet_24j600_disconnectTCP(socket);
} */
}
_nikhil
Am trying library example HTTP DEMO code of ENC24J600 network Library for different controller.
MCU : Dspic33FJ128GP306 i/p
Library : Network_Ethernet_dsPIC (Net_Ethernet_24J600)
In my recent project i was replying to the TCP request which receive from TCP client which is successfully tested.
And now i need to config the controller as a client which send continues response/reply to the server or other interface soft/ module without receiving any request from other end.
am using predefined remote_IP , Port and other network settings.
i was trying using Net_Ethernet_24j600_connectTCP(sysIpAddr, System_Port, My_Port, &sock1); and Net_Ethernet_24j600_startSendTCP(sock1); functions.
But the problem is i have to start initiate request from otherend or PC so that it gettinh start communicate with remote host.
how to start connect and communicate without any request from remote host?
This is the USEr TCP () :
void Net_Ethernet_24j600_UserTCP(SOCKET_24j600_Dsc *socket) {
Uint Reply_Length = 0,Max_request_Len = 7;
Uchar i =0;
// I listen only to web request on port 502 (TCP PORT )
if(socket->destPort != My_Port) {
return;
}
Reply_Length = _REPLY_STRING_LEN;
Net_Ethernet_24j600_putBytesTCP(ETH_Reply_Buf, Reply_Length, socket); //Send temp buffer
/* if( Net_Ethernet_24j600_bufferEmptyTCP(socket)&&(ETH_Reply_Buf >= 2000) ) {
Net_Ethernet_24j600_disconnectTCP(socket);
} */
}
_nikhil