fixes to experimental NormSocket API
parent
9c367b50bc
commit
b66598c119
|
|
@ -1180,6 +1180,7 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
||||||
socketEvent.type = NORM_SOCKET_CONNECT;
|
socketEvent.type = NORM_SOCKET_CONNECT;
|
||||||
NormSetSynStatus(norm_session, false);
|
NormSetSynStatus(norm_session, false);
|
||||||
socket_state = CONNECTED;
|
socket_state = CONNECTED;
|
||||||
|
|
||||||
// Since UDP connect/bind doesn't really work properly on
|
// Since UDP connect/bind doesn't really work properly on
|
||||||
// Windows, the Windows NormSocket server farms out client connections
|
// Windows, the Windows NormSocket server farms out client connections
|
||||||
// to new ephemeral port numbers, so we need to update
|
// to new ephemeral port numbers, so we need to update
|
||||||
|
|
@ -1187,12 +1188,11 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
||||||
remote_node = event.sender;
|
remote_node = event.sender;
|
||||||
UpdateRemoteAddress();
|
UpdateRemoteAddress();
|
||||||
NormChangeDestination(norm_session, NULL, remote_port);
|
NormChangeDestination(norm_session, NULL, remote_port);
|
||||||
if (NORM_OBJECT_INVALID == tx_stream)
|
if ((NORM_OBJECT_INVALID == tx_stream) && !(IsMulticastClient() && IsServerSide()))
|
||||||
{
|
{
|
||||||
tx_stream = NormStreamOpen(norm_session, socket_option.buffer_size);
|
tx_stream = NormStreamOpen(norm_session, socket_option.buffer_size);
|
||||||
InitTxStream(tx_stream, socket_option.buffer_size, socket_option.segment_size, socket_option.num_data);
|
InitTxStream(tx_stream, socket_option.buffer_size, socket_option.segment_size, socket_option.num_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case CONNECTED:
|
case CONNECTED:
|
||||||
if (IsMulticastSocket())
|
if (IsMulticastSocket())
|
||||||
|
|
@ -1200,9 +1200,33 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
||||||
if (IsServerSocket())
|
if (IsServerSocket())
|
||||||
{
|
{
|
||||||
// New client showing up at our multicast party
|
// New client showing up at our multicast party
|
||||||
|
NormSocketInfo* socketInfo = client_table.FindSocketInfo(event.sender);
|
||||||
|
if (NULL == socketInfo)
|
||||||
|
{
|
||||||
|
// Add info for client socket pending acceptance
|
||||||
|
socketInfo = new NormSocketInfo(NormGetSocketInfo(event.sender));
|
||||||
|
if (NULL != socketInfo)
|
||||||
|
{
|
||||||
|
client_table.Insert(*socketInfo);
|
||||||
socketEvent.type = NORM_SOCKET_ACCEPT;
|
socketEvent.type = NORM_SOCKET_ACCEPT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
perror("NormSocket::GetSocketEvent() error: unable to add pending client info to server socket:\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // duplicative accept event for existing socket, so ignore
|
||||||
|
{
|
||||||
|
ProtoAddress remoteAddr;
|
||||||
|
socketInfo->GetRemoteAddress(remoteAddr);
|
||||||
|
fprintf(stderr, "NormSocket::GetSocketEvent() warning: duplicative %s from client %s/%hu...\n",
|
||||||
|
(NORM_REMOTE_SENDER_NEW == event.type) ? "new" : "reset",
|
||||||
|
remoteAddr.GetHostString(), remoteAddr.GetPort());
|
||||||
|
// TBD - should we go ahead and delete this event.sender???
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// TBD - validate if this same server or not (e.g. by source addr/port)
|
// TBD - validate if this same server or not (e.g. by source addr/port)
|
||||||
// Different sender showing up in multicast group!?
|
// Different sender showing up in multicast group!?
|
||||||
|
|
@ -1429,7 +1453,6 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This still allows at least a chance of an ACK to be sent upon completion
|
// This still allows at least a chance of an ACK to be sent upon completion
|
||||||
TRACE("NormSetUserTimer(5) session: %p\n", norm_session);
|
|
||||||
NormSetUserTimer(norm_session, 0.0);
|
NormSetUserTimer(norm_session, 0.0);
|
||||||
}
|
}
|
||||||
socketEvent.type = NORM_SOCKET_CLOSING;
|
socketEvent.type = NORM_SOCKET_CLOSING;
|
||||||
|
|
|
||||||
|
|
@ -936,10 +936,10 @@ class NormFtiExtension5 : public NormHeaderExtension
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
OBJ_SIZE_MSB_OFFSET = (CONTENT_OFFSET)/2, // UINT16 offset
|
OBJ_SIZE_MSB_OFFSET = (CONTENT_OFFSET)/2, // UINT16 offset
|
||||||
OBJ_SIZE_LSB_OFFSET = ((OBJ_SIZE_MSB_OFFSET*2)+2)/4,
|
OBJ_SIZE_LSB_OFFSET = ((OBJ_SIZE_MSB_OFFSET*2)+2)/4,// UINT32 offset
|
||||||
SEG_SIZE_OFFSET = ((OBJ_SIZE_LSB_OFFSET*4)+4)/2,
|
SEG_SIZE_OFFSET = ((OBJ_SIZE_LSB_OFFSET*4)+4)/2, // UINT16 offset
|
||||||
FEC_NDATA_OFFSET = ((SEG_SIZE_OFFSET+1)*2),
|
FEC_NDATA_OFFSET = ((SEG_SIZE_OFFSET+1)*2), // UINT8 offset
|
||||||
FEC_NPARITY_OFFSET = (FEC_NDATA_OFFSET+1)
|
FEC_NPARITY_OFFSET = (FEC_NDATA_OFFSET+1) // UINT8 offset
|
||||||
};
|
};
|
||||||
}; // end class NormFtiExtension5
|
}; // end class NormFtiExtension5
|
||||||
|
|
||||||
|
|
|
||||||
2
protolib
2
protolib
|
|
@ -1 +1 @@
|
||||||
Subproject commit 66092403ffeda703ad5e563be068db345f111a3c
|
Subproject commit 702e909945446275f0313846e988612883fca94a
|
||||||
Loading…
Reference in New Issue