Artifacts Associated With Ticket 218047
Ticket change [52b1b4e2cd] (rid 126360) by nobody on 2000-10-26 00:52:33:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1398 Bug Version: 8.0.4 SubmitDate: '1999-03-02' LastModified: '2000-04-24' Severity: SER Status: Closed Submitter: pat ChangedBy: hobbs OS: Windows NT OSVersion: 4.0, service pack 3 Machine: X86 FixedDate: '2000-10-25' ClosedDate: '2000-04-24' Name: Fred Roeber Extensions: DP CustomShell: patch from Bug ID 893 ReproducibleScript: The code we are using to receive data over a TCP socket follows. # set up a socket to handle upload requests (will call tscan_socket) if {[catch {socket -server tscan_socket $tscan_port} tscan_server_id]} { # command failed so signal receive disabled tscan_display "Error - couldn't connect socket: $tscan_server_id" } proc tscan_socket {chan_id ip_addr port} { global tscan_file_id if {[catch {open "dummy" "w"} tscan_file_id]} { # problem opening file tscan_display "Error - couldn't open file: $tscan_file_id" close $chan_id return } fconfigure $tscan_file_id -translation binary -blocking no # set up to receive the upload data fconfigure $chan_id -translation binary -blocking no fileevent $chan_id readable "tscan_socket_read $chan_id $tscan_file_id" } proc tscan_socket_read {chan_id file_id} { if {[catch {read $chan_id} data]} { tscan_display "problem reading TimeScan data from socket" } elseif {[eof $chan_id]} { tscan_display "Done" } elseif {[catch {puts -nonewline $file_id $data} file_err]} { tscan_display "Error writing TimeScan data to file: $file_err" } else { # everything worked so we are done. Do a display update so that program # isn't unresponsive update return } # we had some problem so shut down channel catch {close $chan_id} catch {close $file_id} } ObservedBehavior: This code above works fine under Solaris. Under windows, we receive an extra '0' byte (not '\0') from the socket connection that gets written to the output file. If the system sending the data just opens a closes a TCP connection, we get a 0 byte file on Solaris but a 1 byte file under Windows/NT 4.0. DesiredBehavior: I expect Solaris and windows to produce the same resultswith the code above. As a note of reference, I found the patch for bug ID 893 on your site. I installed it as it was required to have it installed to get asynchronous sockets to be properly opened under Windows. -- I'm not able to reproduce this with 8.2.3 on NTsp4. -- 04/19/2000 hobbs Response from user: Hello, I had found out the source of this problem after submitting the report. The issue was that the sending application was sending up an OOB (out of band) message with a '0' in it before closing the socket. The intent was the "wake up" the host so it could close the socket quickly. Windows doesn't support OOB messages on sockets so added the '0' to the output stream. I just chalked this up as one of those Unix vs Windows TCP/IP stack differences. Thanks for the response. Fred | Fred J Roeber, BBN Systems & Technologies | -- 04/24/2000 hobbs - foundin initialized to: "obsolete: 8.0.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "63. (unused)"
- title initialized to:
Reading data from socket on Windows appends extra '0' value
- type initialized to: "Bug"
Ticket change [f5dcdac884] (rid 130190) by welch on 2000-10-26 08:13:44:
- closedate changed to: "2000-10-26T01:13:44"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [300ca1f639] (rid 93179) by dgp on 2001-04-01 01:48:02:
- subsystem changed to: "27. Channel Types"
Ticket change [f28d1150db] (rid 109566) by dgp on 2001-04-01 01:48:03:
- closedate changed to: "2001-03-31T18:48:03"
- closer changed to: "dgp"