Changeset 9812 in ntrip for trunk/ntripserver
- Timestamp:
- Aug 23, 2022, 4:30:54 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ntripserver/ntripserver.c
r9643 r9812 1589 1589 } 1590 1590 else if ((nBufferBytes) && (outmode == UDP)) { 1591 int i; 1591 1592 char rtpbuf[1592]; 1592 int i; 1593 int ct = time(0); 1594 udp_tim += (ct - udp_init) * 1000000 / TIME_RESOLUTION; 1595 udp_init = ct; 1596 rtpbuf[0] = (2 << 6); 1597 rtpbuf[1] = 96; 1598 rtpbuf[2] = (udp_seq >> 8) & 0xFF; 1599 rtpbuf[3] = (udp_seq) & 0xFF; 1600 rtpbuf[4] = (udp_tim >> 24) & 0xFF; 1601 rtpbuf[5] = (udp_tim >> 16) & 0xFF; 1602 rtpbuf[6] = (udp_tim >> 8) & 0xFF; 1603 rtpbuf[7] = (udp_tim) & 0xFF; 1604 rtpbuf[8] = (rtpssrc >> 24) & 0xFF; 1605 rtpbuf[9] = (rtpssrc >> 16) & 0xFF; 1606 rtpbuf[10] = (rtpssrc >> 8) & 0xFF; 1607 rtpbuf[11] = (rtpssrc) & 0xFF; 1608 ++udp_seq; 1609 memcpy(rtpbuf + 12, buffer, nBufferBytes); 1610 if ((i = send(socket_tcp, rtpbuf, (size_t) nBufferBytes + 12, MSG_DONTWAIT)) != nBufferBytes + 12) { 1611 if (errno != EAGAIN) { 1612 perror("WARNING: could not send data to Destination caster"); 1613 return; 1614 } 1615 } else 1616 nBufferBytes = 0; 1593 while(nBufferBytes) 1594 { 1595 int ct = time(0); 1596 int s = nBufferBytes; 1597 if(s > 1400) 1598 s = 1400; 1599 udp_tim += (ct - udp_init) * 1000000 / TIME_RESOLUTION; 1600 udp_init = ct; 1601 rtpbuf[0] = (2 << 6); 1602 rtpbuf[1] = 96; 1603 rtpbuf[2] = (udp_seq >> 8) & 0xFF; 1604 rtpbuf[3] = (udp_seq) & 0xFF; 1605 rtpbuf[4] = (udp_tim >> 24) & 0xFF; 1606 rtpbuf[5] = (udp_tim >> 16) & 0xFF; 1607 rtpbuf[6] = (udp_tim >> 8) & 0xFF; 1608 rtpbuf[7] = (udp_tim) & 0xFF; 1609 rtpbuf[8] = (rtpssrc >> 24) & 0xFF; 1610 rtpbuf[9] = (rtpssrc >> 16) & 0xFF; 1611 rtpbuf[10] = (rtpssrc >> 8) & 0xFF; 1612 rtpbuf[11] = (rtpssrc) & 0xFF; 1613 ++udp_seq; 1614 memcpy(rtpbuf + 12, buffer, s); 1615 if ((i = send(socket_tcp, rtpbuf, (size_t) s + 12, MSG_DONTWAIT)) != s + 12) { 1616 if (errno != EAGAIN) { 1617 perror("WARNING: could not send data to Destination caster"); 1618 return; 1619 } 1620 } else 1621 nBufferBytes -= s; 1622 } 1617 1623 i = recv(socket_tcp, rtpbuf, sizeof(rtpbuf), 0); 1618 1624 if (i >= 12 && (unsigned char) rtpbuf[0] == (2 << 6) … … 1996 2002 fprintf(stderr, " Note that the program automatically falls back from mode rtsp to mode http and\n"); 1997 2003 fprintf(stderr, " further to mode ntrip1 if necessary.\n\n"); 1998 fprintf(stderr, " -a <DestHost> Destination caster/server name or address, default: 127.0.0.1,\n");2004 fprintf(stderr, " -a <DestHost> Destination caster/server name or address, default: " NTRIP_CASTER ",\n"); 1999 2005 fprintf(stderr, " mandatory\n"); 2000 2006 fprintf(stderr, " -p <DestPort> Destination caster/server port, default: 2101,\n");
Note:
See TracChangeset
for help on using the changeset viewer.